/*
 * Created by JFormDesigner on Sun Dec 15 11:11:41 ICT 2013
 */

package fashionshop.gui;

import java.awt.Component;
import java.awt.Container;
import java.awt.Desktop;
import java.awt.HeadlessException;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Vector;

import javax.imageio.ImageIO;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.KeyStroke;
import javax.swing.LayoutStyle;
import javax.swing.ListSelectionModel;
import javax.swing.SwingConstants;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

import com.toedter.calendar.JDateChooser;

import fashionshop.bll.CategoryBLL;
import fashionshop.bll.CustomerBLL;
import fashionshop.bll.ImportBLL;
import fashionshop.bll.ImportDetailBLL;
import fashionshop.bll.LevelBLL;
import fashionshop.bll.OrderBLL;
import fashionshop.bll.OrderDetailBLL;
import fashionshop.bll.ProductBLL;
import fashionshop.bll.StatisticBLL;
import fashionshop.utility.ImageUtility;

/**
 * @author Hoan Tran
 */
public class MainScreen extends JFrame {
	
	private String PATH = "D:\\img\\";
	
	private Vector productTableRecords;
	private Vector productTableTitle;
	private Vector customerTableRecords;
	private Vector customerTableTitle;
	private Vector orderTableRecords;
	private Vector orderTableTitle;
	private Vector importTableRecords;
	private Vector importTableTitle;
	
	private Vector importDetailTableRecords;
	private Vector importDetailTableTitle;
	private Vector productImportTableRecords;
	private Vector productImportTableTitle;
	private int currentImportID = 0;
	
	private void LoadImportDetail(int currentImport) throws Exception{
		importDetailTableTitle = new Vector();
		importDetailTableRecords = new Vector();
		tableImportDetail.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		tableImportDetail.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "none");
		tableImportDetail.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "none");
		importDetailTableTitle.add("ID Đơn hàng");
		importDetailTableTitle.add("ID Sản phẩm");
		importDetailTableTitle.add("Mã Sản phẩm");
		importDetailTableTitle.add("Tên Sản phẩm");
		importDetailTableTitle.add("Số lượng");
//		importDetailTableTitle.add("Đơn giá");
//		importDetailTableTitle.add("Tổng cộng");
		ImportDetailBLL importDetailBll = new ImportDetailBLL();
		importDetailTableRecords = importDetailBll.loadImportDetail(currentImport);
		tableImportDetail.setModel(new DefaultTableModel(importDetailTableRecords, importDetailTableTitle));
		
	}
	
	private void LoadProductImport() throws Exception{
		productImportTableTitle = new Vector();
		productImportTableRecords = new Vector();
		tableProductImport.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		tableProductImport.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "none");
		tableProductImport.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "none");
		productImportTableTitle.add("ID");
		productImportTableTitle.add("Phân loại");
		productImportTableTitle.add("Tên sản phẩm");
		productImportTableTitle.add("Mã sản phẩm");
		productImportTableTitle.add("Số lượng");
		productImportTableTitle.add("Hình ảnh");
		productImportTableTitle.add("Màu sắc");
		productImportTableTitle.add("Giá tiền");
		productImportTableTitle.add("Mô tả");
		productImportTableTitle.add("Ngày tạo");
		productImportTableTitle.add("Giá khuyến mãi");
		ProductBLL productBll = new ProductBLL();
		productImportTableRecords = productBll.loadAllProduct();
		tableProductImport.setModel(new DefaultTableModel(productImportTableRecords, productImportTableTitle));
		
	}
	
	private void LoadImport() throws Exception{
		importTableTitle = new Vector();
		importTableRecords = new Vector();
		tableImport.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		tableImport.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "none");
		tableImport.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "none");
		importTableTitle.add("ID");
		importTableTitle.add("Tổng cộng");
		importTableTitle.add("Ngày tạo");
		importTableTitle.add("Ghi chú");
		importTableTitle.add("Sao lưu");
		ImportBLL importBll = new ImportBLL();
		importTableRecords = importBll.loadAllImport();
		tableImport.setModel(new DefaultTableModel(importTableRecords, importTableTitle));
		
	}
	
	private void LoadOrder() throws Exception{
		orderTableTitle = new Vector();
		orderTableRecords = new Vector();
		tableOrder.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		tableOrder.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "none");
		tableOrder.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "none");
		orderTableTitle.add("ID");
		orderTableTitle.add("ID Khách hàng");
		orderTableTitle.add("Tên khách hàng");
		orderTableTitle.add("Tổng cộng");
		orderTableTitle.add("Chiết khấu");
		orderTableTitle.add("Ngày đặt hàng");
		orderTableTitle.add("Ngày thanh toán");
		orderTableTitle.add("Ghi chú");
		orderTableTitle.add("Tình trạng");
		orderTableTitle.add("Sao lưu");
		OrderBLL orderBll = new OrderBLL();
		orderTableRecords = orderBll.loadAllOrder();
		tableOrder.setModel(new DefaultTableModel(orderTableRecords, orderTableTitle));
		
	}
	
	private void LoadCustomer() throws Exception{
		customerTableTitle = new Vector();
		customerTableRecords = new Vector();
		tableCustomer.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		tableCustomer.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "none");
		tableCustomer.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "none");
		customerTableTitle.add("ID");
		customerTableTitle.add("Tên khách hàng");
		customerTableTitle.add("Số điện thoại");
		customerTableTitle.add("Địa chỉ");
		customerTableTitle.add("Cấp độ");
		customerTableTitle.add("Điểm");
		CustomerBLL customerBll = new CustomerBLL();
		customerTableRecords = customerBll.loadAllCustomer();
		tableCustomer.setModel(new DefaultTableModel(customerTableRecords, customerTableTitle));
		
	}
	
	private void LoadProduct() throws Exception{
		productTableTitle = new Vector();
		productTableRecords = new Vector();
		tableProduct.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		tableProduct.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "none");
		tableProduct.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "none");
		productTableTitle.add("ID");
		productTableTitle.add("Phân loại");
		productTableTitle.add("Tên sản phẩm");
		productTableTitle.add("Mã sản phẩm");
		productTableTitle.add("Số lượng");
		productTableTitle.add("Hình ảnh");
		productTableTitle.add("Màu sắc");
		productTableTitle.add("Giá tiền");
		productTableTitle.add("Mô tả");
		productTableTitle.add("Ngày tạo");
		productTableTitle.add("Giá khuyến mãi");
		ProductBLL productBll = new ProductBLL();
		productTableRecords = productBll.loadAllProduct();
		tableProduct.setModel(new DefaultTableModel(productTableRecords, productTableTitle));
		
	}
	
	public void LoadAllCombobox() throws Exception{
		ResultSet result = CategoryBLL.loadAllCategory();
		
		// Product Category
		cbSearchCategoryName.addItem("Tất cả");
		while (result.next()){
			cbCategoryName.addItem(result.getString("Name"));
			cbSearchCategoryName.addItem(result.getString("Name"));
		}
		
		// Customer Level
		cbSearchCustomerLevel.addItem("Tất cả");
		result = LevelBLL.LoadAllLevel();
		while (result.next()){
			cbSearchCustomerLevel.addItem(result.getString("Name"));
		}
		
		// Order Status
		cbOrderStatus.addItem("Đang xử lý");
		cbOrderStatus.addItem("Đã thanh toán");
		cbOrderStatus.addItem("Hủy");
	}
	
	public MainScreen() throws Exception {
		initComponents();
		this.LoadProduct();
		this.LoadCustomer();
		this.LoadOrder();
		this.LoadImport();
		this.LoadAllCombobox();
		this.LoadProductImport();
	}

	private void thisComponentAdded(ContainerEvent e) {
		// TODO add your code here
	}

	private void panelMainStateChanged(ChangeEvent e) {
		// TODO add your code here
	}

	private void tableProductMousePressed(MouseEvent e) {
		// TODO add your code here
		int selectedRow = tableProduct.getSelectedRow();
        if (selectedRow != -1) {
            Vector currentProduct = (Vector) productTableRecords.get(selectedRow);
            txtProductID.setText(currentProduct.get(0).toString());
			cbCategoryName.setSelectedItem(currentProduct.get(1).toString());
    		txtProductName.setText(currentProduct.get(2).toString());
    		txtProductCode.setText(currentProduct.get(3).toString());
    		txtProductQuantity.setText(currentProduct.get(4).toString());
    		txtProductColor.setText(currentProduct.get(6).toString());
    		txtProductPrice.setText(currentProduct.get(7).toString());
    		txtProductDescription.setText(currentProduct.get(8).toString());
    		txtProductCreateDate.setText(currentProduct.get(9).toString());
    		txtProductSalePrice.setText(currentProduct.get(10).toString());
    		txtImage.setText(currentProduct.get(5).toString());
    		
//			BufferedImage img = null;//new BufferedImage(50, 50, 0);
//			try {
//				img = ImageIO.read(new File(PATH + currentProduct.get(5).toString()));
//			} catch (IOException e1) {
//				// TODO Auto-generated catch block
//				e1.printStackTrace();
//			}
//			img = ImageUtility.scaleImage(img, 100, 100, null);
//            ImageIcon icon=new ImageIcon(img);
//            labelShowImage.setIcon(icon);
//    		File f = new File(PATH + currentProduct.get(5).toString());
    		if(new File(PATH + currentProduct.get(5).toString()).isFile()){
    			BufferedImage img = null;//new BufferedImage(50, 50, 0);
				try {
					img = ImageIO.read(new File(PATH + currentProduct.get(5).toString()));
				} catch (IOException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				img = ImageUtility.scaleImage(img, 230, 130, null);
                ImageIcon icon=new ImageIcon(img);
                labelImage.setIcon(icon);
    		}
    		else{
    			labelImage.setIcon(null);
    		}
    		
    		btnProductSave.setText("Cập nhật sản phẩm");
        }
	}

	private void btnProductResetActionPerformed(ActionEvent e) {
		// TODO add your code here
		txtProductID.setText(null);
//		cbCategoryName.setSelectedIndex(1);
		txtProductName.setText(null);
		txtProductCode.setText(null);
		txtProductQuantity.setText(null);
		txtProductColor.setText(null);
		txtProductPrice.setText(null);
		txtProductDescription.setText(null);
		txtProductCreateDate.setText(null);
		txtProductSalePrice.setText(null);
		txtImage.setText(null);
		labelImage.setIcon(null);
		btnProductSave.setText("Thêm sản phẩm");
	}

	private void btnProductSaveActionPerformed(ActionEvent e) {
		// TODO add your code here
		if(btnProductSave.getText().equals("Thêm sản phẩm")){
			Vector record = new Vector();
	        record.add(txtProductID.getText());
	        record.add(cbCategoryName.getSelectedItem());
	        record.add(txtProductName.getText());
	        record.add(txtProductCode.getText());
	        record.add(txtProductQuantity.getText());
	        record.add(txtImage.getText());
	        record.add(txtProductColor.getText());
	        record.add(txtProductPrice.getText());
	        record.add(txtProductDescription.getText());
	        record.add(txtProductCreateDate.getText());
	        record.add(txtProductSalePrice.getText());
	        productTableRecords.add(record);
	        tableProduct.setModel(new DefaultTableModel(productTableRecords, productTableTitle));
		}
		else{
			int selectedRow = tableProduct.getSelectedRow();
	        if (selectedRow != -1) {
	            Vector currentProduct = (Vector) productTableRecords.get(selectedRow);
	            currentProduct.setElementAt(cbCategoryName.getSelectedItem(), 1);
	            currentProduct.setElementAt(txtProductName.getText(), 2);
	            currentProduct.setElementAt(txtProductCode.getText(), 3);
	            currentProduct.setElementAt(txtProductQuantity.getText(), 4);
	            currentProduct.setElementAt(txtImage.getText(), 5);
	            currentProduct.setElementAt(txtProductColor.getText(), 6);
	            currentProduct.setElementAt(txtProductPrice.getText(), 7);
	            currentProduct.setElementAt(txtProductDescription.getText(), 8);
	            currentProduct.setElementAt(txtProductCreateDate.getText(), 9);
	            currentProduct.setElementAt(txtProductSalePrice.getText(), 10);
	            tableProduct.repaint();
	        }
		}
		btnProductResetActionPerformed(e);
		
	}

	private void btnProductReloadActionPerformed(ActionEvent e) {
		// TODO add your code here
		try {
			this.LoadProduct();
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}

	private void btnImageActionPerformed(ActionEvent e) {
		// TODO add your code here
		JFileChooser chooser = new JFileChooser();
		chooser.setMultiSelectionEnabled(false);
		FileNameExtensionFilter filter = new FileNameExtensionFilter("JPG & GIF Images", "jpg", "gif");
		chooser.setFileFilter(filter);
		int option = chooser.showOpenDialog(panelProduct);
		if (option == JFileChooser.APPROVE_OPTION) {
			if(new File(chooser.getSelectedFile().getAbsolutePath()).isFile()){
				Path src = Paths.get(chooser.getSelectedFile().getAbsolutePath());
				Path des = Paths.get(PATH + "/" + chooser.getSelectedFile().getName());
				try {
					Files.copy(src, des, StandardCopyOption.REPLACE_EXISTING);
				} catch (IOException e2) {
					// TODO Auto-generated catch block
					e2.printStackTrace();
				}

				         
				BufferedImage img = null;
				try {
					img = ImageIO.read(new File(des.toString()));
				} catch (IOException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				img = ImageUtility.scaleImage(img, 230, 130, null);
                ImageIcon icon=new ImageIcon(img);
                labelImage.setIcon(icon);
                txtImage.setText(chooser.getSelectedFile().getName());
    		}
		}
		else {
		}
	}

	private void btnProductSaveAllActionPerformed(ActionEvent e) {
		// TODO add your code here
		ProductBLL productBll = new ProductBLL();
		try {
			if(productBll.SaveAll(this.productTableRecords))
				JOptionPane.showMessageDialog(this, "Lưu dữ liệu thành công", "Thông báo", JOptionPane.INFORMATION_MESSAGE);
		} catch (HeadlessException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		try {
			this.LoadProduct();
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}

	private void btnCustomerResetActionPerformed(ActionEvent e) {
		// TODO add your code here
		txtCustomerID.setText(null);
		txtCustomerName.setText(null);
		txtCustomerAddress.setText(null);
		txtCustomerPhone.setText(null);
		txtCustomerLevel.setText(null);
		txtCustomerScore.setText(null);
		btnCustomerSave.setText("Thêm khách hàng");
	}

	private void btnCustomerSaveActionPerformed(ActionEvent e) {
		// TODO add your code here
		if(btnCustomerSave.getText().equals("Thêm khách hàng")){
			Vector record = new Vector();
	        record.add(txtCustomerID.getText());
	        record.add(txtCustomerName.getText());
	        record.add(txtCustomerPhone.getText());
	        record.add(txtCustomerAddress.getText());
	        record.add(txtCustomerLevel.getText());
	        record.add(txtCustomerScore.getText());
	        customerTableRecords.add(record);
	        tableCustomer.setModel(new DefaultTableModel(customerTableRecords, customerTableTitle));
		}
		else{
			int selectedRow = tableCustomer.getSelectedRow();
	        if (selectedRow != -1) {
	            Vector currentCustomer = (Vector) customerTableRecords.get(selectedRow);
	            currentCustomer.setElementAt(txtCustomerName.getText(), 1);
	            currentCustomer.setElementAt(txtCustomerPhone.getText(), 2);
	            currentCustomer.setElementAt(txtCustomerAddress.getText(), 3);
	            tableCustomer.repaint();
	        }
		}
		btnCustomerResetActionPerformed(e);
	}

	private void btnCustomerReloadActionPerformed(ActionEvent e) {
		// TODO add your code here
		try {
			this.LoadCustomer();
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}

	private void btnCustomerSaveAllActionPerformed(ActionEvent e) {
		// TODO add your code here
		CustomerBLL customerBll = new CustomerBLL();
		try {
			if(customerBll.SaveAll(this.customerTableRecords))
				JOptionPane.showMessageDialog(this, "Lưu dữ liệu thành công", "Thông báo", JOptionPane.INFORMATION_MESSAGE);
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		try {
			this.LoadCustomer();
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}

	private void scrollPaneProductMousePressed(MouseEvent e) {
		// TODO add your code here
	}

	private void scrollPaneProductMouseClicked(MouseEvent e) {
		// TODO add your code here
	}

	private void tableCustomerMousePressed(MouseEvent e) {
		// TODO add your code here
		int selectedRow = tableCustomer.getSelectedRow();
        if (selectedRow != -1) {
            Vector currentCustomer = (Vector) customerTableRecords.get(selectedRow);
            txtCustomerID.setText(currentCustomer.get(0).toString());
			txtCustomerName.setText(currentCustomer.get(1).toString());
    		txtCustomerPhone.setText(currentCustomer.get(2).toString());
    		txtCustomerAddress.setText(currentCustomer.get(3).toString());
    		txtCustomerLevel.setText(currentCustomer.get(4).toString());
    		txtCustomerScore.setText(currentCustomer.get(5).toString());
    		
    		btnCustomerSave.setText("Cập nhật khách hàng");
        }
	}

	private void tableOrderMousePressed(MouseEvent e) {
		// TODO add your code here
		int selectedRow = tableOrder.getSelectedRow();
        if (selectedRow != -1) {
            Vector currentOrder = (Vector) orderTableRecords.get(selectedRow);
            txtOrderID.setText(currentOrder.get(0).toString());
            txtOrderCustomerID.setText(currentOrder.get(1).toString());
            txtOrderCustomer.setText(currentOrder.get(2).toString());
            txtOrderSum.setText(currentOrder.get(3).toString());
            txtOrderDiscount.setText(currentOrder.get(4).toString());
            txtOrderDate.setText(currentOrder.get(5).toString());
        	
            if(currentOrder.get(6) == null || currentOrder.get(6).toString().isEmpty() || currentOrder.get(6).toString().equals("")){
            	txtPaymentDate.setText("");
			}
			else{
				txtPaymentDate.setText(currentOrder.get(6).toString());
			}
            	
            	
            
            txtOrderNote.setText(currentOrder.get(7).toString());
            cbOrderStatus.setSelectedItem(currentOrder.get(8).toString());            
            
            // Logic check
            if(cbOrderStatus.getSelectedItem().toString() == "Đã thanh toán"){
            	cbOrderStatus.setEnabled(false);
            	btnOrderCustomer.setVisible(false);
            }
            else{
            	cbOrderStatus.setEnabled(true);
            	btnOrderCustomer.setVisible(true);
            }
            if(txtOrderID.getText().equals(""))
            	btnOrderAddProduct.setVisible(false);
            else
            	btnOrderAddProduct.setVisible(true);
    		btnOrderSave.setText("Cập nhật đơn hàng");
    		
        }
        
	}

	private void btnOrderResetActionPerformed(ActionEvent e) {
		// TODO add your code here
		txtOrderID.setText(null);
		txtOrderCustomer.setText(null);
		txtOrderCustomerID.setText(null);
		txtOrderDate.setText(null);
		txtPaymentDate.setText(null);
		cbOrderStatus.setSelectedItem("Đang xử lý");
		txtOrderSum.setText(null);
		txtOrderDiscount.setText(null);
		txtOrderNote.setText(null);
		
		// Logic check
		cbOrderStatus.setEnabled(true);
    	btnOrderCustomer.setVisible(true);
    	btnOrderAddProduct.setVisible(false);
		btnOrderSave.setText("Tạo đơn hàng");
	}

	private void btnOrderSaveActionPerformed(ActionEvent e) {
		// TODO add your code here
		if(btnOrderSave.getText().equals("Tạo đơn hàng")){
			Vector record = new Vector();
			record.add(txtOrderID.getText());
	        record.add(txtOrderCustomerID.getText());
	        record.add(txtOrderCustomer.getText());
	        record.add(txtOrderSum.getText());
	        record.add(txtOrderDiscount.getText());
	        record.add(txtOrderDate.getText());
	        record.add(txtPaymentDate.getText());
	        record.add(txtOrderNote.getText());
	        record.add(cbOrderStatus.getSelectedItem());
	        record.add("Chưa sao lưu");
	        
	        orderTableRecords.add(record);
	        tableOrder.setModel(new DefaultTableModel(orderTableRecords, orderTableTitle));
		}
		else{
			int selectedRow = tableOrder.getSelectedRow();
	        if (selectedRow != -1) {
	            Vector currentOrder = (Vector) orderTableRecords.get(selectedRow);
	            currentOrder.setElementAt(txtOrderCustomerID.getText(), 1);
	            currentOrder.setElementAt(txtOrderCustomer.getText(), 2);
	            currentOrder.setElementAt(txtOrderSum.getText(), 3);
	            currentOrder.setElementAt(txtOrderDiscount.getText(), 4);
	            currentOrder.setElementAt(txtOrderDate.getText(), 5);
	            currentOrder.setElementAt(txtPaymentDate.getText(), 6);
	            currentOrder.setElementAt(txtOrderNote.getText(), 7);
	            currentOrder.setElementAt(cbOrderStatus.getSelectedItem(), 8);
	            currentOrder.setElementAt("Chưa sao lưu", 9);
	            tableOrder.repaint();
	        }
		}
		btnOrderResetActionPerformed(e);
	}

	private void btnOrderReloadActionPerformed(ActionEvent e) {
		// TODO add your code here
		try {
			this.LoadOrder();
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}

	private void btnOrderSaveAllActionPerformed(ActionEvent e) {
		// TODO add your code here
		OrderBLL orderBll = new OrderBLL();
		try {
			if(orderBll.SaveAll(this.orderTableRecords))
				JOptionPane.showMessageDialog(this, "Lưu dữ liệu thành công", "Thông báo", JOptionPane.INFORMATION_MESSAGE);
			else
				JOptionPane.showMessageDialog(this, "Lưu dữ liệu thất bại", "Lỗi", JOptionPane.ERROR_MESSAGE);
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		try {
			this.LoadOrder();
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
	}

	private void cbOrderStatusActionPerformed(ActionEvent e) {
		// TODO add your code here
		if(cbOrderStatus.getSelectedItem().toString() == "Đã thanh toán"){
			txtPaymentDate.setText(new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()));
		}
		else{
			txtPaymentDate.setText("");
		}
	}

	private void btnOrderAddProductActionPerformed(ActionEvent e) {
		// TODO add your code here
		ProductAdd productAdd = new ProductAdd(this);
		if(txtOrderID.getText().toString().isEmpty() || txtOrderID.getText().toString() == null || txtOrderID.getText().toString().equals("")){
			productAdd.setCurrentOrder(0);
		}
		else{
			productAdd.setCurrentOrder(Integer.parseInt(txtOrderID.getText()));
		}
		if(cbOrderStatus.getSelectedItem().toString() == "Đã thanh toán"){
			productAdd.setCanEdit(false);
		}
		else{
			productAdd.setCanEdit(true);
		}
		productAdd.setModal(true);
		productAdd.show();
		txtOrderSum.setText(productAdd.getOrderSum().toString());
	}

	private void btnSearchProductActionPerformed(ActionEvent e) {
		// TODO add your code here
		ProductBLL productBll = new ProductBLL();
		if(cbSearchCategoryName.getSelectedItem().toString() != "Tất cả"){
			try {
				productBll.setCategoryId(CategoryBLL.getIdFromName(cbSearchCategoryName.getSelectedItem().toString()));
			} catch (Exception e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		}
		productBll.setName(txtSearchProductName.getText());
		productBll.setCode(txtSearchProductCode.getText());
		productBll.setColor(txtSearchProductColor.getText());
		productBll.setDescription(txtSearchProductDescription.getText());
		
		BigDecimal priceFrom;
		BigDecimal priceTo;
		if(txtSearchProductPriceFrom.getText().toString().isEmpty() || txtSearchProductPriceFrom.getText().toString() == null || txtSearchProductPriceFrom.getText().toString().equals("")){
			priceFrom = null;
		}
		else{
			priceFrom = new BigDecimal(txtSearchProductPriceFrom.getText());
		}
		
		if(txtSearchProductPriceTo.getText().toString().isEmpty() || txtSearchProductPriceTo.getText().toString() == null || txtSearchProductPriceTo.getText().toString().equals("")){
			priceTo = null;
		}
		else{
			priceTo = new BigDecimal(txtSearchProductPriceTo.getText());
		}
			
		try {
			productTableRecords = productBll.AdvancedSearch(productBll, priceFrom, priceTo);
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		tableProduct.setModel(new DefaultTableModel(productTableRecords, productTableTitle));
	}

	private void txtProductPriceKeyTyped(KeyEvent e) {
		// TODO add your code here
		char vChar = e.getKeyChar();
        if (!(Character.isDigit(vChar)
                || (vChar == KeyEvent.VK_BACK_SPACE)
                || (vChar == KeyEvent.VK_DELETE))) {
            e.consume();
        }
	}

	private void txtProductSalePriceKeyTyped(KeyEvent e) {
		// TODO add your code here
		char vChar = e.getKeyChar();
        if (!(Character.isDigit(vChar)
                || (vChar == KeyEvent.VK_BACK_SPACE)
                || (vChar == KeyEvent.VK_DELETE))) {
            e.consume();
        }
	}

	private void txtSearchProductPriceFromKeyTyped(KeyEvent e) {
		// TODO add your code here
		char vChar = e.getKeyChar();
        if (!(Character.isDigit(vChar)
                || (vChar == KeyEvent.VK_BACK_SPACE)
                || (vChar == KeyEvent.VK_DELETE))) {
            e.consume();
        }
	}

	private void txtSearchProductPriceToKeyTyped(KeyEvent e) {
		// TODO add your code here
		char vChar = e.getKeyChar();
        if (!(Character.isDigit(vChar)
                || (vChar == KeyEvent.VK_BACK_SPACE)
                || (vChar == KeyEvent.VK_DELETE))) {
            e.consume();
        }
	}

	private void txtCustomerPhoneKeyTyped(KeyEvent e) {
		// TODO add your code here
		char vChar = e.getKeyChar();
        if (!(Character.isDigit(vChar)
                || (vChar == KeyEvent.VK_BACK_SPACE)
                || (vChar == KeyEvent.VK_DELETE))) {
            e.consume();
        }
	}

	private void dateChooserPropertyChange(PropertyChangeEvent e) {
		// TODO add your code here
	}

	private void btnSearchCustomerActionPerformed(ActionEvent e) {
		// TODO add your code here
		CustomerBLL customerBll = new CustomerBLL();
		if(cbSearchCustomerLevel.getSelectedItem().toString() != "Tất cả"){
			try {
				customerBll.setLevelId(LevelBLL.getIdFromName(cbSearchCustomerLevel.getSelectedItem().toString()));
			} catch (Exception e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		}
		else{
			customerBll.setLevelId(0);
		}
		customerBll.setName(txtSearchCustomerName.getText());
		customerBll.setPhone(txtSearchCustomerPhone.getText());
		customerBll.setAddress(txtSearchCustomerAddress.getText());
		
		int scoreFrom;
		int scoreTo;
		if(txtSearchCustomerScoreFrom.getText() == null || txtSearchCustomerScoreFrom.getText().toString().isEmpty() || txtSearchCustomerScoreFrom.getText().toString().equals("")){
			scoreFrom = -1;
		}
		else{
			scoreFrom = Integer.parseInt(txtSearchCustomerScoreFrom.getText());
		}
		
		if(txtSearchCustomerScoreTo.getText() == null || txtSearchCustomerScoreTo.getText().toString().isEmpty() || txtSearchCustomerScoreTo.getText().toString().equals("")){
			scoreTo = -1;
		}
		else{
			scoreTo = Integer.parseInt(txtSearchCustomerScoreTo.getText());
		}
			
		try {
			customerTableRecords = customerBll.AdvancedSearch(customerBll, scoreFrom, scoreTo);
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		tableCustomer.setModel(new DefaultTableModel(customerTableRecords, customerTableTitle));
	}

	private void button3ActionPerformed(ActionEvent e) {
		// TODO add your code here
	}

	private void txtSearchCustomerPhoneKeyTyped(KeyEvent e) {
		// TODO add your code here
		char vChar = e.getKeyChar();
        if (!(Character.isDigit(vChar)
                || (vChar == KeyEvent.VK_BACK_SPACE)
                || (vChar == KeyEvent.VK_DELETE))) {
            e.consume();
        }
	}

	private void txtSearchCustomerScoreFromKeyTyped(KeyEvent e) {
		// TODO add your code here
		char vChar = e.getKeyChar();
        if (!(Character.isDigit(vChar)
                || (vChar == KeyEvent.VK_BACK_SPACE)
                || (vChar == KeyEvent.VK_DELETE))) {
            e.consume();
        }
	}

	private void txtSearchCustomerScoreToKeyTyped(KeyEvent e) {
		// TODO add your code here
		char vChar = e.getKeyChar();
        if (!(Character.isDigit(vChar)
                || (vChar == KeyEvent.VK_BACK_SPACE)
                || (vChar == KeyEvent.VK_DELETE))) {
            e.consume();
        }
	}

	private void btnOrderCustomerActionPerformed(ActionEvent e) {
		// TODO add your code here
		CustomerAdd customerAdd = new CustomerAdd(this);
		customerAdd.setModal(true);
		customerAdd.show();
		txtOrderCustomer.setText(customerAdd.getCustomerName());
		txtOrderCustomerID.setText(customerAdd.getCustomerID());
		
	}

	private void btnSearchOrderActionPerformed(ActionEvent e) {
		// TODO add your code here
		OrderBLL orderBll = new OrderBLL();
		orderBll.setNote(txtSearchOrderDescription.getText());
		String customerName = txtSearchOrderCustomer.getText();
		
		String orderDateFrom = null;
		String orderDateTo = null;
		String paymentDateFrom = null;
		String paymentDateTo = null;
		
		if(orderDateFromChooser.getDate() != null){
			Date jud = orderDateFromChooser.getDate();
			orderDateFrom = new SimpleDateFormat("yyyy-MM-dd").format(jud);
		}
		if(orderDateToChooser.getDate() != null){
			Date jud = orderDateToChooser.getDate();
			orderDateTo = new SimpleDateFormat("yyyy-MM-dd").format(jud);
		}
		if(paymentDateFromChooser.getDate() != null){
			Date jud = paymentDateFromChooser.getDate();
			paymentDateFrom = new SimpleDateFormat("yyyy-MM-dd").format(jud);
		}
		if(paymentDateToChooser.getDate() != null){
			Date jud = paymentDateToChooser.getDate();
			paymentDateTo = new SimpleDateFormat("yyyy-MM-dd").format(jud);
		}
		
		try {
			orderTableRecords = orderBll.AdvancedSearch(orderBll, customerName, orderDateFrom, orderDateTo, paymentDateFrom, paymentDateTo);
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		tableOrder.setModel(new DefaultTableModel(orderTableRecords, orderTableTitle));
		
	}

	private void btnExportToExcelActionPerformed(ActionEvent e) {
		// TODO add your code here
		String statictisName = "Product";
		StatisticBLL exp = new StatisticBLL(); 
		String name = statictisName + "_" + new SimpleDateFormat("yyyy-MM-dd_hh-mm-ss").format(Calendar.getInstance().getTime()) + ".xls";
		File file = new File(name);
		exp.toExcel(tableProduct, file);
//		try {
//			Desktop.getDesktop().open(new File(name));
//		} catch (IOException e1) {
//			// TODO Auto-generated catch block
//			e1.printStackTrace();
//		}      
	}

	private void btnImportResetActionPerformed(ActionEvent e) {
		// TODO add your code here
		txtImportID.setText(null);
		txtImportSum.setText(null);
		txtImportCreateDate.setText(null);
		txtImportNote.setText(null);
		
		// Logic check
		btnImportSave.setText("Tạo phiếu nhập");
	}

	private void tableImportMousePressed(MouseEvent e) {
		// TODO add your code here
		int selectedRow = tableImport.getSelectedRow();
        if (selectedRow != -1) {
            Vector currentImport = (Vector) importTableRecords.get(selectedRow);
            txtImportID.setText(currentImport.get(0).toString());
            txtImportSum.setText(currentImport.get(1).toString());
            txtImportCreateDate.setText(currentImport.get(2).toString());
            txtImportNote.setText(currentImport.get(3).toString());
            
            if(txtImportID.getText().toString() == null || txtImportID.getText().toString().isEmpty() || txtImportID.getText().toString().equals("")){
            	JOptionPane.showMessageDialog(this, "Phiếu nhập không tồn tại", "Lỗi", JOptionPane.ERROR_MESSAGE);
            	btnImportSaveAll.setEnabled(false);
    		}
    		else{
    			btnImportSaveAll.setEnabled(true);
    			try {
    				this.currentImportID = Integer.parseInt(txtImportID.getText());
					this.LoadImportDetail(currentImportID);
				} catch (NumberFormatException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				} catch (Exception e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
    		}
            // Logic check
    		btnImportSave.setText("Cập nhật phiếu nhập");
    		
        }
	}

	private void btnImportSaveActionPerformed(ActionEvent e) {
		// TODO add your code here
//		if(btnImportSave.getText().equals("Tạo phiếu nhập")){
//			Vector record = new Vector();
//			record.add(txtImportID.getText());
//	        record.add(txtImportSum.getText());
//	        record.add(txtImportCreateDate.getText());
//	        record.add(txtImportNote.getText());
//	        record.add("Chưa sao lưu");
	        
	        ImportBLL importBll = new ImportBLL();
	        if(txtImportSum.getText().equals(""))
	        	importBll.setSum(new BigDecimal("0"));
	        else
	        	importBll.setSum(new BigDecimal(txtImportSum.getText()));
	        importBll.setCreateDate(new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()));
	        importBll.setNote(txtImportNote.getText());
	        
	        try {
				importBll.SaveAll(importBll);
			} catch (Exception e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
	        try {
				this.LoadImport();
			} catch (Exception e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
//	        importTableRecords.add(record);
//	        tableImport.setModel(new DefaultTableModel(importTableRecords, importTableTitle));
//		}
//		else{
//			int selectedRow = tableImport.getSelectedRow();
//	        if (selectedRow != -1) {
//	            Vector currentImport = (Vector) importTableRecords.get(selectedRow);
//	            currentImport.setElementAt(txtImportSum.getText(), 1);
//	            currentImport.setElementAt(txtImportCreateDate.getText(), 2);
//	            currentImport.setElementAt(txtImportNote.getText(), 3);
//	            currentImport.setElementAt("Chưa sao lưu", 4);
//	            tableOrder.repaint();
//	        }
//		}
		btnImportResetActionPerformed(e);
	}

	private void btnImportReloadActionPerformed(ActionEvent e) {
		// TODO add your code here
		try {
			this.LoadImport();
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	}

	private void btnImportSaveAllActionPerformed(ActionEvent e) {
		// TODO add your code here
//		ImportBLL importBll = new ImportBLL();
//		try {
//			if(importBll.SaveAll(this.importTableRecords))
//				JOptionPane.showMessageDialog(this, "Lưu dữ liệu thành công", "Thông báo", JOptionPane.INFORMATION_MESSAGE);
//			else
//				JOptionPane.showMessageDialog(this, "Lưu dữ liệu thất bại", "Lỗi", JOptionPane.ERROR_MESSAGE);
//		} catch (Exception e1) {
//			// TODO Auto-generated catch block
//			e1.printStackTrace();
//		}
//		try {
//			this.LoadImport();
//		} catch (Exception e1) {
//			// TODO Auto-generated catch block
//			e1.printStackTrace();
//		}
	}

	private void btnProductDeleteActionPerformed(ActionEvent e) {
		// TODO add your code here
	}

	private void btnOrderDetailReloadActionPerformed(ActionEvent e) {
		// TODO add your code here
	}

	private void btnOrderDetailSaveAllActionPerformed(ActionEvent e) {
		// TODO add your code here
	}

	private void btnProductAddSearchActionPerformed(ActionEvent e) {
		// TODO add your code here
	}

	private void txtProductAddQuantityKeyTyped(KeyEvent e) {
		// TODO add your code here
	}

	private void btnProductAddActionPerformed(ActionEvent e) {
		// TODO add your code here
	}

	private void txtProductImportQuantityKeyTyped(KeyEvent e) {
		// TODO add your code here
		char vChar = e.getKeyChar();
        if (!(Character.isDigit(vChar)
                || (vChar == KeyEvent.VK_BACK_SPACE)
                || (vChar == KeyEvent.VK_DELETE))) {
            e.consume();
        }
	}

	private void btnProductImportSearchActionPerformed(ActionEvent e) {
		// TODO add your code here
		String keyword;
		keyword = txtProductImportKeyword.getText();
		ProductBLL productBll = new ProductBLL();
		try {
			productImportTableRecords = productBll.BasicSearch(keyword);
		} catch (Exception e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		tableProductImport.setModel(new DefaultTableModel(productImportTableRecords, productImportTableTitle));
	}

	private void btnProductImportActionPerformed(ActionEvent e) {
		// TODO add your code here
		int selectedRow = tableProductImport.getSelectedRow();
		if(txtProductImportQuantity.getText() == null || txtProductImportQuantity.getText().isEmpty() || txtProductImportQuantity.getText().equals("")){
			JOptionPane.showMessageDialog(this, "Chưa nhập số lượng sản phẩm", "Lỗi", JOptionPane.ERROR_MESSAGE);
			return;
		}
        if (selectedRow != -1) {
			Vector selectedProduct = (Vector) productImportTableRecords.get(selectedRow);
	        boolean flag = true;
	        int selectedID = Integer.parseInt(selectedProduct.get(0).toString());
	        for(int i = 0; i < tableImportDetail.getRowCount(); i++){
	        	int importDetailProductID = Integer.parseInt(tableImportDetail.getValueAt(i, 1).toString());
	        	if(selectedID == importDetailProductID){
	        		int quantity = Integer.parseInt(txtProductImportQuantity.getText().toString()) + Integer.parseInt(tableImportDetail.getValueAt(i, 4).toString());
	        		tableImportDetail.setValueAt(quantity, i, 4);
	        		flag = false;
	        		break;
	        	}
	        }
	        if(flag){
	        	Vector record = new Vector();
	        	record.add(currentImportID);
				record.add(selectedProduct.get(0).toString());
		        record.add(selectedProduct.get(3).toString());
		        record.add(selectedProduct.get(2).toString());
		        record.add(txtProductImportQuantity.getText());
	        	importDetailTableRecords.add(record);
	        	tableImportDetail.setModel(new DefaultTableModel(importDetailTableRecords, importDetailTableTitle));
	        }
	        
	        
        }
        else{
        	JOptionPane.showMessageDialog(this, "Chưa chọn sản phẩm", "Lỗi", JOptionPane.ERROR_MESSAGE);
        }
	}

	private void initComponents() throws Exception {
		// JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
		// Generated using JFormDesigner Evaluation license - Hoan Tran
		panelMain = new JTabbedPane();
		panelProduct = new JPanel();
		panel5 = new JPanel();
		label4 = new JLabel();
		label5 = new JLabel();
		label6 = new JLabel();
		label7 = new JLabel();
		label8 = new JLabel();
		label9 = new JLabel();
		label10 = new JLabel();
		label11 = new JLabel();
		label12 = new JLabel();
		label13 = new JLabel();
		txtProductID = new JTextField();
		txtProductName = new JTextField();
		txtProductCode = new JTextField();
		txtProductQuantity = new JTextField();
		txtProductColor = new JTextField();
		txtProductPrice = new JTextField();
		txtProductSalePrice = new JTextField();
		txtProductCreateDate = new JTextField();
		labelImage = new JLabel();
		txtImage = new JTextField();
		btnImage = new JButton();
		cbCategoryName = new JComboBox();
		btnProductReset = new JButton();
		btnProductSave = new JButton();
		scrollPane1 = new JScrollPane();
		txtProductDescription = new JTextArea();
		scrollPaneProduct = new JScrollPane();
		tableProduct = new JTable();
		btnProductSaveAll = new JButton();
		btnProductReload = new JButton();
		panel9 = new JPanel();
		label42 = new JLabel();
		label43 = new JLabel();
		label44 = new JLabel();
		label45 = new JLabel();
		label46 = new JLabel();
		txtSearchProductName = new JTextField();
		txtSearchProductColor = new JTextField();
		txtSearchProductDescription = new JTextField();
		txtSearchProductPriceFrom = new JTextField();
		txtSearchProductCode = new JTextField();
		txtSearchProductPriceTo = new JTextField();
		label1 = new JLabel();
		label2 = new JLabel();
		cbSearchCategoryName = new JComboBox();
		btnSearchProduct = new JButton();
		panelCustomer = new JPanel();
		panel6 = new JPanel();
		label15 = new JLabel();
		label16 = new JLabel();
		label17 = new JLabel();
		label18 = new JLabel();
		label19 = new JLabel();
		label22 = new JLabel();
		txtCustomerID = new JTextField();
		txtCustomerName = new JTextField();
		txtCustomerPhone = new JTextField();
		txtCustomerAddress = new JTextField();
		txtCustomerScore = new JTextField();
		btnCustomerReset = new JButton();
		btnCustomerSave = new JButton();
		txtCustomerLevel = new JTextField();
		scrollPaneProduct2 = new JScrollPane();
		tableCustomer = new JTable();
		btnCustomerSaveAll = new JButton();
		btnCustomerReload = new JButton();
		panel10 = new JPanel();
		label47 = new JLabel();
		label48 = new JLabel();
		label49 = new JLabel();
		label50 = new JLabel();
		label51 = new JLabel();
		txtSearchCustomerName = new JTextField();
		txtSearchCustomerAddress = new JTextField();
		txtSearchCustomerScoreFrom = new JTextField();
		txtSearchCustomerPhone = new JTextField();
		txtSearchCustomerScoreTo = new JTextField();
		label3 = new JLabel();
		btnSearchCustomer = new JButton();
		cbSearchCustomerLevel = new JComboBox();
		panelOrder = new JPanel();
		panel7 = new JPanel();
		label26 = new JLabel();
		label28 = new JLabel();
		label29 = new JLabel();
		label30 = new JLabel();
		label32 = new JLabel();
		label33 = new JLabel();
		label34 = new JLabel();
		label35 = new JLabel();
		txtOrderID = new JTextField();
		txtOrderCustomer = new JTextField();
		txtOrderDate = new JTextField();
		txtPaymentDate = new JTextField();
		txtOrderSum = new JTextField();
		txtOrderDiscount = new JTextField();
		txtOrderNote = new JTextField();
		cbOrderStatus = new JComboBox();
		btnOrderCustomer = new JButton();
		txtOrderCustomerID = new JTextField();
		btnOrderReset = new JButton();
		btnOrderSave = new JButton();
		btnOrderAddProduct = new JButton();
		scrollPaneProduct3 = new JScrollPane();
		tableOrder = new JTable();
		btnOrderSaveAll = new JButton();
		btnOrderReload = new JButton();
		panel11 = new JPanel();
		label52 = new JLabel();
		label53 = new JLabel();
		label54 = new JLabel();
		label55 = new JLabel();
		label56 = new JLabel();
		txtSearchOrderID = new JTextField();
		txtSearchOrderDescription = new JTextField();
		label14 = new JLabel();
		btnSearchOrder = new JButton();
		orderDateFromChooser = new JDateChooser();
		orderDateToChooser = new JDateChooser();
		paymentDateFromChooser = new JDateChooser();
		paymentDateToChooser = new JDateChooser();
		label20 = new JLabel();
		txtSearchOrderCustomer = new JTextField();
		panelImport = new JPanel();
		panel8 = new JPanel();
		label37 = new JLabel();
		label39 = new JLabel();
		label40 = new JLabel();
		label41 = new JLabel();
		txtImportID = new JTextField();
		txtImportSum = new JTextField();
		txtImportCreateDate = new JTextField();
		txtImportNote = new JTextField();
		btnImportReset = new JButton();
		btnImportSave = new JButton();
		scrollPaneProduct4 = new JScrollPane();
		tableImport = new JTable();
		btnImportSaveAll = new JButton();
		btnImportReload = new JButton();
		scrollPane3 = new JScrollPane();
		tableImportDetail = new JTable();
		scrollPane2 = new JScrollPane();
		tableProductImport = new JTable();
		label21 = new JLabel();
		txtProductImportKeyword = new JTextField();
		btnProductImportSearch = new JButton();
		label23 = new JLabel();
		txtProductImportQuantity = new JTextField();
		btnProductImport = new JButton();
		panelReport = new JPanel();
		dateChooser = new JDateChooser();
		panelStatistic = new JPanel();
		btnExportToExcel = new JButton();

		//======== this ========
		setTitle("FASHION SHOP");
		addContainerListener(new ContainerAdapter() {
			@Override
			public void componentAdded(ContainerEvent e) {
				thisComponentAdded(e);
			}
		});
		Container contentPane = getContentPane();

		//======== panelMain ========
		{
			panelMain.addChangeListener(new ChangeListener() {
				@Override
				public void stateChanged(ChangeEvent e) {
					panelMainStateChanged(e);
				}
			});

			//======== panelProduct ========
			{

				// JFormDesigner evaluation mark
				panelProduct.setBorder(new javax.swing.border.CompoundBorder(
					new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
						"JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
						javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
						java.awt.Color.red), panelProduct.getBorder())); panelProduct.addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});


				//======== panel5 ========
				{
					panel5.setBorder(new TitledBorder("Chi ti\u1ebft s\u1ea3n ph\u1ea9m"));

					//---- label4 ----
					label4.setText("ID");

					//---- label5 ----
					label5.setText("Ph\u00e2n lo\u1ea1i");

					//---- label6 ----
					label6.setText("T\u00ean s\u1ea3n ph\u1ea9m");

					//---- label7 ----
					label7.setText("M\u00e3 s\u1ea3n ph\u1ea9m");

					//---- label8 ----
					label8.setText("S\u1ed1 l\u01b0\u1ee3ng");

					//---- label9 ----
					label9.setText("M\u00e0u s\u1eafc");

					//---- label10 ----
					label10.setText("Gi\u00e1 b\u00e1n");

					//---- label11 ----
					label11.setText("Gi\u00e1 khuy\u1ebfn m\u00e3i");

					//---- label12 ----
					label12.setText("Ng\u00e0y t\u1ea1o");

					//---- label13 ----
					label13.setText("M\u00f4 t\u1ea3");

					//---- txtProductID ----
					txtProductID.setEditable(false);

					//---- txtProductPrice ----
					txtProductPrice.addKeyListener(new KeyAdapter() {
						@Override
						public void keyTyped(KeyEvent e) {
							txtProductPriceKeyTyped(e);
						}
					});

					//---- txtProductSalePrice ----
					txtProductSalePrice.addKeyListener(new KeyAdapter() {
						@Override
						public void keyTyped(KeyEvent e) {
							txtProductSalePriceKeyTyped(e);
						}
					});

					//---- txtProductCreateDate ----
					txtProductCreateDate.setEditable(false);

					//---- btnImage ----
					btnImage.setText("T\u1ea3i \u1ea3nh");
					btnImage.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnImageActionPerformed(e);
						}
					});

					//---- btnProductReset ----
					btnProductReset.setText("X\u00f3a bi\u1ec3u m\u1eabu");
					btnProductReset.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnProductResetActionPerformed(e);
						}
					});

					//---- btnProductSave ----
					btnProductSave.setText("Th\u00eam s\u1ea3n ph\u1ea9m");
					btnProductSave.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnProductSaveActionPerformed(e);
						}
					});

					//======== scrollPane1 ========
					{
						scrollPane1.setViewportView(txtProductDescription);
					}

					GroupLayout panel5Layout = new GroupLayout(panel5);
					panel5.setLayout(panel5Layout);
					panel5Layout.setHorizontalGroup(
						panel5Layout.createParallelGroup()
							.addGroup(panel5Layout.createSequentialGroup()
								.addGroup(panel5Layout.createParallelGroup()
									.addGroup(panel5Layout.createSequentialGroup()
										.addContainerGap()
										.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
											.addGroup(panel5Layout.createSequentialGroup()
												.addGroup(panel5Layout.createParallelGroup()
													.addComponent(label8)
													.addComponent(label9))
												.addGap(41, 41, 41)
												.addGroup(panel5Layout.createParallelGroup()
													.addComponent(txtProductQuantity)
													.addComponent(txtProductColor)))
											.addGroup(panel5Layout.createSequentialGroup()
												.addGroup(panel5Layout.createParallelGroup()
													.addComponent(label5, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)
													.addComponent(label6)
													.addComponent(label7)
													.addComponent(label4, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE))
												.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
												.addGroup(panel5Layout.createParallelGroup()
													.addComponent(txtProductCode)
													.addComponent(txtProductName)
													.addGroup(panel5Layout.createSequentialGroup()
														.addComponent(cbCategoryName, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)
														.addGap(0, 0, Short.MAX_VALUE))
													.addComponent(txtProductID))))
										.addGap(66, 66, 66)
										.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
											.addGroup(panel5Layout.createSequentialGroup()
												.addComponent(label10)
												.addGap(74, 74, 74)
												.addComponent(txtProductPrice, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE))
											.addGroup(panel5Layout.createSequentialGroup()
												.addGroup(panel5Layout.createParallelGroup()
													.addComponent(label11, GroupLayout.PREFERRED_SIZE, 92, GroupLayout.PREFERRED_SIZE)
													.addComponent(label12, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)
													.addComponent(label13, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE))
												.addGap(18, 18, 18)
												.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
													.addComponent(txtProductSalePrice, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
													.addComponent(txtProductCreateDate, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
													.addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))))
										.addGap(71, 71, 71)
										.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
											.addGroup(panel5Layout.createSequentialGroup()
												.addComponent(txtImage, GroupLayout.PREFERRED_SIZE, 144, GroupLayout.PREFERRED_SIZE)
												.addGap(18, 18, 18)
												.addComponent(btnImage))
											.addComponent(labelImage, GroupLayout.PREFERRED_SIZE, 229, GroupLayout.PREFERRED_SIZE)))
									.addGroup(panel5Layout.createSequentialGroup()
										.addGap(318, 318, 318)
										.addComponent(btnProductReset)
										.addGap(18, 18, 18)
										.addComponent(btnProductSave)))
								.addContainerGap(94, Short.MAX_VALUE))
					);
					panel5Layout.setVerticalGroup(
						panel5Layout.createParallelGroup()
							.addGroup(panel5Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel5Layout.createParallelGroup()
									.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
										.addGroup(panel5Layout.createSequentialGroup()
											.addComponent(labelImage, GroupLayout.PREFERRED_SIZE, 156, GroupLayout.PREFERRED_SIZE)
											.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
											.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(btnImage)
												.addComponent(txtImage, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
										.addGroup(panel5Layout.createSequentialGroup()
											.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label10)
												.addComponent(txtProductPrice, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGap(18, 18, 18)
											.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label11)
												.addComponent(txtProductSalePrice, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGap(18, 18, 18)
											.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label12)
												.addComponent(txtProductCreateDate, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGap(56, 56, 56)
											.addComponent(label13)
											.addGap(42, 42, 42)))
									.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
										.addGroup(panel5Layout.createSequentialGroup()
											.addComponent(txtProductID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
											.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
											.addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE))
										.addGroup(panel5Layout.createSequentialGroup()
											.addComponent(label4)
											.addGap(18, 18, 18)
											.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label5)
												.addComponent(cbCategoryName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGap(18, 18, 18)
											.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label6)
												.addComponent(txtProductName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGap(18, 18, 18)
											.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label7)
												.addComponent(txtProductCode, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGap(18, 18, 18)
											.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label8)
												.addComponent(txtProductQuantity, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGap(18, 18, 18)
											.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label9)
												.addComponent(txtProductColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))))
								.addGap(45, 45, 45)
								.addGroup(panel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(btnProductSave)
									.addComponent(btnProductReset))
								.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
					);
				}

				//======== scrollPaneProduct ========
				{
					scrollPaneProduct.addMouseListener(new MouseAdapter() {
						@Override
						public void mouseClicked(MouseEvent e) {
							scrollPaneProductMouseClicked(e);
						}
						@Override
						public void mousePressed(MouseEvent e) {
							scrollPaneProductMousePressed(e);
						}
					});

					//---- tableProduct ----
					tableProduct.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
					tableProduct.addMouseListener(new MouseAdapter() {
						@Override
						public void mousePressed(MouseEvent e) {
							tableProductMousePressed(e);
						}
					});
					scrollPaneProduct.setViewportView(tableProduct);
				}

				//---- btnProductSaveAll ----
				btnProductSaveAll.setText("L\u01b0u d\u1eef li\u1ec7u");
				btnProductSaveAll.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnProductSaveAllActionPerformed(e);
					}
				});

				//---- btnProductReload ----
				btnProductReload.setText("T\u1ea3i l\u1ea1i d\u1eef li\u1ec7u");
				btnProductReload.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						button3ActionPerformed(e);
						btnProductReloadActionPerformed(e);
					}
				});

				//======== panel9 ========
				{
					panel9.setBorder(new TitledBorder("T\u00ecm ki\u1ebfm s\u1ea3n ph\u1ea9m"));

					//---- label42 ----
					label42.setText("T\u00ean s\u1ea3n ph\u1ea9m");

					//---- label43 ----
					label43.setText("M\u00e3 s\u1ea3n ph\u1ea9m");

					//---- label44 ----
					label44.setText("M\u00e0u s\u1eafc");

					//---- label45 ----
					label45.setText("M\u00f4 t\u1ea3");

					//---- label46 ----
					label46.setText("Gi\u00e1 t\u1eeb");

					//---- txtSearchProductPriceFrom ----
					txtSearchProductPriceFrom.addKeyListener(new KeyAdapter() {
						@Override
						public void keyTyped(KeyEvent e) {
							txtSearchProductPriceFromKeyTyped(e);
						}
					});

					//---- txtSearchProductPriceTo ----
					txtSearchProductPriceTo.addKeyListener(new KeyAdapter() {
						@Override
						public void keyTyped(KeyEvent e) {
							txtSearchProductPriceToKeyTyped(e);
						}
					});

					//---- label1 ----
					label1.setText("\u0110\u1ebfn");

					//---- label2 ----
					label2.setText("Ph\u00e2n lo\u1ea1i");

					//---- btnSearchProduct ----
					btnSearchProduct.setText("T\u00ecm ki\u1ebfm");
					btnSearchProduct.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnSearchProductActionPerformed(e);
						}
					});

					GroupLayout panel9Layout = new GroupLayout(panel9);
					panel9.setLayout(panel9Layout);
					panel9Layout.setHorizontalGroup(
						panel9Layout.createParallelGroup()
							.addGroup(panel9Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel9Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
									.addGroup(panel9Layout.createSequentialGroup()
										.addGroup(panel9Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
											.addComponent(label46, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
											.addComponent(label1, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))
										.addGap(41, 41, 41)
										.addGroup(panel9Layout.createParallelGroup()
											.addComponent(txtSearchProductPriceFrom, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
											.addComponent(txtSearchProductPriceTo, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)))
									.addGroup(panel9Layout.createSequentialGroup()
										.addGroup(panel9Layout.createParallelGroup()
											.addGroup(panel9Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
												.addComponent(label44)
												.addComponent(label45)
												.addComponent(label43, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
												.addComponent(label42, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE))
											.addComponent(label2))
										.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(panel9Layout.createParallelGroup()
											.addComponent(txtSearchProductDescription, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
											.addComponent(txtSearchProductColor)
											.addComponent(txtSearchProductCode, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
											.addComponent(txtSearchProductName, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
											.addComponent(cbSearchCategoryName, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)))
									.addGroup(GroupLayout.Alignment.TRAILING, panel9Layout.createSequentialGroup()
										.addComponent(btnSearchProduct, GroupLayout.PREFERRED_SIZE, 155, GroupLayout.PREFERRED_SIZE)
										.addGap(19, 19, 19)))
								.addGap(74, 74, 74))
					);
					panel9Layout.setVerticalGroup(
						panel9Layout.createParallelGroup()
							.addGroup(panel9Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel9Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label2)
									.addComponent(cbSearchCategoryName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel9Layout.createParallelGroup()
									.addComponent(label42)
									.addComponent(txtSearchProductName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel9Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label43)
									.addComponent(txtSearchProductCode, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel9Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label44)
									.addComponent(txtSearchProductColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel9Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label45)
									.addComponent(txtSearchProductDescription, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel9Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label46)
									.addComponent(txtSearchProductPriceFrom, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel9Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label1)
									.addComponent(txtSearchProductPriceTo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(30, 30, 30)
								.addComponent(btnSearchProduct)
								.addContainerGap())
					);
				}

				GroupLayout panelProductLayout = new GroupLayout(panelProduct);
				panelProduct.setLayout(panelProductLayout);
				panelProductLayout.setHorizontalGroup(
					panelProductLayout.createParallelGroup()
						.addGroup(panelProductLayout.createSequentialGroup()
							.addGroup(panelProductLayout.createParallelGroup()
								.addGroup(panelProductLayout.createSequentialGroup()
									.addGap(532, 532, 532)
									.addComponent(btnProductReload)
									.addGap(61, 61, 61)
									.addComponent(btnProductSaveAll)
									.addGap(0, 496, Short.MAX_VALUE))
								.addGroup(panelProductLayout.createSequentialGroup()
									.addGap(21, 21, 21)
									.addGroup(panelProductLayout.createParallelGroup()
										.addComponent(scrollPaneProduct, GroupLayout.DEFAULT_SIZE, 1248, Short.MAX_VALUE)
										.addGroup(panelProductLayout.createSequentialGroup()
											.addComponent(panel5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
											.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
											.addComponent(panel9, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
							.addContainerGap())
				);
				panelProductLayout.setVerticalGroup(
					panelProductLayout.createParallelGroup()
						.addGroup(panelProductLayout.createSequentialGroup()
							.addContainerGap()
							.addGroup(panelProductLayout.createParallelGroup()
								.addComponent(panel5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(panel9, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addGap(18, 18, 18)
							.addComponent(scrollPaneProduct, GroupLayout.DEFAULT_SIZE, 235, Short.MAX_VALUE)
							.addGap(18, 18, 18)
							.addGroup(panelProductLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
								.addComponent(btnProductReload)
								.addComponent(btnProductSaveAll))
							.addGap(50, 50, 50))
				);
			}
			panelMain.addTab("QU\u1ea2N L\u00dd S\u1ea2N PH\u1ea8M", panelProduct);

			//======== panelCustomer ========
			{

				//======== panel6 ========
				{
					panel6.setBorder(new TitledBorder("Chi ti\u1ebft kh\u00e1ch h\u00e0ng"));

					//---- label15 ----
					label15.setText("ID");

					//---- label16 ----
					label16.setText("C\u1ea5p \u0111\u1ed9");

					//---- label17 ----
					label17.setText("T\u00ean kh\u00e1ch h\u00e0ng");

					//---- label18 ----
					label18.setText("S\u1ed1 \u0111i\u1ec7n tho\u1ea1i");

					//---- label19 ----
					label19.setText("\u0110\u1ecba ch\u1ec9");

					//---- label22 ----
					label22.setText("\u0110i\u1ec3m");

					//---- txtCustomerID ----
					txtCustomerID.setEditable(false);

					//---- txtCustomerPhone ----
					txtCustomerPhone.addKeyListener(new KeyAdapter() {
						@Override
						public void keyTyped(KeyEvent e) {
							txtCustomerPhoneKeyTyped(e);
						}
					});

					//---- txtCustomerScore ----
					txtCustomerScore.setEditable(false);

					//---- btnCustomerReset ----
					btnCustomerReset.setText("X\u00f3a bi\u1ec3u m\u1eabu");
					btnCustomerReset.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnProductResetActionPerformed(e);
							btnCustomerResetActionPerformed(e);
						}
					});

					//---- btnCustomerSave ----
					btnCustomerSave.setText("Th\u00eam kh\u00e1ch h\u00e0ng");
					btnCustomerSave.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnProductSaveActionPerformed(e);
							btnCustomerSaveActionPerformed(e);
						}
					});

					//---- txtCustomerLevel ----
					txtCustomerLevel.setEditable(false);

					GroupLayout panel6Layout = new GroupLayout(panel6);
					panel6.setLayout(panel6Layout);
					panel6Layout.setHorizontalGroup(
						panel6Layout.createParallelGroup()
							.addGroup(panel6Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel6Layout.createParallelGroup()
									.addGroup(GroupLayout.Alignment.TRAILING, panel6Layout.createSequentialGroup()
										.addGap(0, 202, Short.MAX_VALUE)
										.addComponent(btnCustomerReset)
										.addGap(45, 45, 45)
										.addComponent(btnCustomerSave)
										.addGap(215, 215, 215))
									.addGroup(panel6Layout.createSequentialGroup()
										.addGroup(panel6Layout.createParallelGroup()
											.addGroup(panel6Layout.createSequentialGroup()
												.addGap(317, 317, 317)
												.addGroup(panel6Layout.createParallelGroup()
													.addComponent(label22, GroupLayout.PREFERRED_SIZE, 92, GroupLayout.PREFERRED_SIZE)
													.addComponent(label16, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE))
												.addGap(18, 18, 18)
												.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
													.addComponent(txtCustomerScore, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
													.addComponent(txtCustomerLevel, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)))
											.addGroup(panel6Layout.createSequentialGroup()
												.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
													.addComponent(label19, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
													.addComponent(label17, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
													.addComponent(label18, GroupLayout.Alignment.LEADING)
													.addComponent(label15, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE))
												.addGap(25, 25, 25)
												.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
													.addComponent(txtCustomerName)
													.addComponent(txtCustomerPhone)
													.addComponent(txtCustomerAddress, GroupLayout.DEFAULT_SIZE, 132, Short.MAX_VALUE)
													.addComponent(txtCustomerID, GroupLayout.DEFAULT_SIZE, 132, Short.MAX_VALUE))))
										.addContainerGap(112, Short.MAX_VALUE))))
					);
					panel6Layout.setVerticalGroup(
						panel6Layout.createParallelGroup()
							.addGroup(panel6Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel6Layout.createParallelGroup()
									.addGroup(panel6Layout.createSequentialGroup()
										.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(label16)
											.addComponent(txtCustomerLevel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
										.addGap(18, 18, 18)
										.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(txtCustomerScore, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
											.addComponent(label22)))
									.addGroup(panel6Layout.createSequentialGroup()
										.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(label15)
											.addComponent(txtCustomerID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
										.addGap(21, 21, 21)
										.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(label17)
											.addComponent(txtCustomerName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
										.addGap(18, 18, 18)
										.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(label18)
											.addComponent(txtCustomerPhone, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
										.addGap(18, 18, 18)
										.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(label19)
											.addComponent(txtCustomerAddress, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
								.addGap(52, 52, 52)
								.addGroup(panel6Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(btnCustomerReset)
									.addComponent(btnCustomerSave))
								.addContainerGap(51, Short.MAX_VALUE))
					);
				}

				//======== scrollPaneProduct2 ========
				{
					scrollPaneProduct2.addMouseListener(new MouseAdapter() {
						@Override
						public void mouseClicked(MouseEvent e) {
							scrollPaneProductMouseClicked(e);
						}
						@Override
						public void mousePressed(MouseEvent e) {
							scrollPaneProductMousePressed(e);
						}
					});

					//---- tableCustomer ----
					tableCustomer.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
					tableCustomer.setAutoCreateRowSorter(true);
					tableCustomer.addMouseListener(new MouseAdapter() {
						@Override
						public void mousePressed(MouseEvent e) {
							tableProductMousePressed(e);
							tableCustomerMousePressed(e);
						}
					});
					scrollPaneProduct2.setViewportView(tableCustomer);
				}

				//---- btnCustomerSaveAll ----
				btnCustomerSaveAll.setText("L\u01b0u d\u1eef li\u1ec7u");
				btnCustomerSaveAll.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnCustomerSaveAllActionPerformed(e);
						btnCustomerSaveAllActionPerformed(e);
					}
				});

				//---- btnCustomerReload ----
				btnCustomerReload.setText("T\u1ea3i l\u1ea1i d\u1eef li\u1ec7u");
				btnCustomerReload.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnCustomerReloadActionPerformed(e);
					}
				});

				//======== panel10 ========
				{
					panel10.setBorder(new TitledBorder("T\u00ecm ki\u1ebfm kh\u00e1ch h\u00e0ng"));

					//---- label47 ----
					label47.setText("T\u00ean kh\u00e1ch h\u00e0ng");

					//---- label48 ----
					label48.setText("S\u1ed1 \u0111i\u1ec7n tho\u1ea1i");

					//---- label49 ----
					label49.setText("\u0110\u1ecba ch\u1ec9");

					//---- label50 ----
					label50.setText("C\u1ea5p \u0111\u1ed9");

					//---- label51 ----
					label51.setText("\u0110i\u1ec3m t\u1eeb");

					//---- txtSearchCustomerScoreFrom ----
					txtSearchCustomerScoreFrom.addKeyListener(new KeyAdapter() {
						@Override
						public void keyTyped(KeyEvent e) {
							txtSearchCustomerScoreFromKeyTyped(e);
						}
					});

					//---- txtSearchCustomerPhone ----
					txtSearchCustomerPhone.addKeyListener(new KeyAdapter() {
						@Override
						public void keyTyped(KeyEvent e) {
							txtSearchCustomerPhoneKeyTyped(e);
						}
					});

					//---- txtSearchCustomerScoreTo ----
					txtSearchCustomerScoreTo.addKeyListener(new KeyAdapter() {
						@Override
						public void keyTyped(KeyEvent e) {
							txtSearchCustomerScoreToKeyTyped(e);
						}
					});

					//---- label3 ----
					label3.setText("\u0110\u1ebfn");

					//---- btnSearchCustomer ----
					btnSearchCustomer.setText("T\u00ecm ki\u1ebfm");
					btnSearchCustomer.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnSearchProductActionPerformed(e);
							btnSearchCustomerActionPerformed(e);
						}
					});

					GroupLayout panel10Layout = new GroupLayout(panel10);
					panel10.setLayout(panel10Layout);
					panel10Layout.setHorizontalGroup(
						panel10Layout.createParallelGroup()
							.addGroup(panel10Layout.createSequentialGroup()
								.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
									.addGroup(GroupLayout.Alignment.LEADING, panel10Layout.createSequentialGroup()
										.addContainerGap()
										.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
											.addComponent(label48, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
											.addComponent(label47, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE)
											.addComponent(label49, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE))
										.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
											.addComponent(txtSearchCustomerAddress, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
											.addComponent(txtSearchCustomerPhone, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
											.addComponent(txtSearchCustomerName, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)))
									.addGroup(panel10Layout.createSequentialGroup()
										.addContainerGap()
										.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
											.addGroup(panel10Layout.createSequentialGroup()
												.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
													.addComponent(label51, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
													.addComponent(label3, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))
												.addGap(41, 41, 41)
												.addGroup(panel10Layout.createParallelGroup()
													.addComponent(txtSearchCustomerScoreFrom)
													.addComponent(txtSearchCustomerScoreTo)))
											.addGroup(panel10Layout.createSequentialGroup()
												.addComponent(label50, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)
												.addGap(33, 33, 33)
												.addComponent(cbSearchCustomerLevel, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE))))
									.addGroup(GroupLayout.Alignment.LEADING, panel10Layout.createSequentialGroup()
										.addGap(91, 91, 91)
										.addComponent(btnSearchCustomer, GroupLayout.PREFERRED_SIZE, 113, GroupLayout.PREFERRED_SIZE)))
								.addContainerGap(53, Short.MAX_VALUE))
					);
					panel10Layout.setVerticalGroup(
						panel10Layout.createParallelGroup()
							.addGroup(panel10Layout.createSequentialGroup()
								.addGap(19, 19, 19)
								.addGroup(panel10Layout.createParallelGroup()
									.addComponent(label47)
									.addComponent(txtSearchCustomerName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(txtSearchCustomerPhone, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addComponent(label48))
								.addGap(18, 18, 18)
								.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label49)
									.addComponent(txtSearchCustomerAddress, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label50)
									.addComponent(cbSearchCustomerLevel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label51)
									.addComponent(txtSearchCustomerScoreFrom, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel10Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label3)
									.addComponent(txtSearchCustomerScoreTo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
								.addComponent(btnSearchCustomer)
								.addGap(25, 25, 25))
					);
				}

				GroupLayout panelCustomerLayout = new GroupLayout(panelCustomer);
				panelCustomer.setLayout(panelCustomerLayout);
				panelCustomerLayout.setHorizontalGroup(
					panelCustomerLayout.createParallelGroup()
						.addGroup(panelCustomerLayout.createSequentialGroup()
							.addGap(73, 73, 73)
							.addGroup(panelCustomerLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
								.addGroup(panelCustomerLayout.createSequentialGroup()
									.addGap(427, 427, 427)
									.addComponent(btnCustomerReload)
									.addGap(58, 58, 58)
									.addComponent(btnCustomerSaveAll))
								.addGroup(panelCustomerLayout.createSequentialGroup()
									.addComponent(panel6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addGap(95, 95, 95)
									.addComponent(panel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addComponent(scrollPaneProduct2))
							.addContainerGap(96, Short.MAX_VALUE))
				);
				panelCustomerLayout.setVerticalGroup(
					panelCustomerLayout.createParallelGroup()
						.addGroup(panelCustomerLayout.createSequentialGroup()
							.addContainerGap()
							.addGroup(panelCustomerLayout.createParallelGroup()
								.addComponent(panel6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(panel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addGap(71, 71, 71)
							.addComponent(scrollPaneProduct2, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE)
							.addGap(18, 18, 18)
							.addGroup(panelCustomerLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
								.addComponent(btnCustomerSaveAll)
								.addComponent(btnCustomerReload))
							.addContainerGap(85, Short.MAX_VALUE))
				);
			}
			panelMain.addTab("QU\u1ea2N L\u00dd KH\u00c1CH H\u00c0NG", panelCustomer);

			//======== panelOrder ========
			{

				//======== panel7 ========
				{
					panel7.setBorder(new TitledBorder("Chi ti\u1ebft \u0111\u01a1n \u0111\u1eb7t h\u00e0ng"));

					//---- label26 ----
					label26.setText("ID");

					//---- label28 ----
					label28.setText("T\u00ean kh\u00e1ch h\u00e0ng");

					//---- label29 ----
					label29.setText("Ng\u00e0y \u0111\u1eb7t");

					//---- label30 ----
					label30.setText("Ng\u00e0y thanh to\u00e1n");

					//---- label32 ----
					label32.setText("T\u00ecnh tr\u1ea1ng");

					//---- label33 ----
					label33.setText("T\u1ed5ng c\u1ed9ng");

					//---- label34 ----
					label34.setText("Chi\u1ebft kh\u1ea5u");

					//---- label35 ----
					label35.setText("Ghi ch\u00fa");

					//---- txtOrderID ----
					txtOrderID.setEditable(false);

					//---- txtOrderCustomer ----
					txtOrderCustomer.setEditable(false);

					//---- txtOrderDate ----
					txtOrderDate.setEditable(false);

					//---- txtPaymentDate ----
					txtPaymentDate.setEditable(false);

					//---- txtOrderSum ----
					txtOrderSum.setEditable(false);

					//---- txtOrderDiscount ----
					txtOrderDiscount.setEditable(false);

					//---- cbOrderStatus ----
					cbOrderStatus.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							cbOrderStatusActionPerformed(e);
						}
					});

					//---- btnOrderCustomer ----
					btnOrderCustomer.setText("Ch\u1ecdn");
					btnOrderCustomer.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnOrderCustomerActionPerformed(e);
						}
					});

					//---- txtOrderCustomerID ----
					txtOrderCustomerID.setVisible(false);

					//---- btnOrderReset ----
					btnOrderReset.setText("X\u00f3a bi\u1ec3u m\u1eabu");
					btnOrderReset.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnProductResetActionPerformed(e);
							btnCustomerResetActionPerformed(e);
							btnOrderResetActionPerformed(e);
						}
					});

					//---- btnOrderSave ----
					btnOrderSave.setText("T\u1ea1o \u0111\u01a1n h\u00e0ng");
					btnOrderSave.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnProductSaveActionPerformed(e);
							btnCustomerSaveActionPerformed(e);
							btnOrderSaveActionPerformed(e);
						}
					});

					//---- btnOrderAddProduct ----
					btnOrderAddProduct.setText("Chi ti\u1ebft \u0111\u01a1n h\u00e0ng");
					btnOrderAddProduct.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnOrderAddProductActionPerformed(e);
						}
					});

					GroupLayout panel7Layout = new GroupLayout(panel7);
					panel7.setLayout(panel7Layout);
					panel7Layout.setHorizontalGroup(
						panel7Layout.createParallelGroup()
							.addGroup(panel7Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel7Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
									.addGroup(panel7Layout.createSequentialGroup()
										.addGroup(panel7Layout.createParallelGroup()
											.addGroup(panel7Layout.createSequentialGroup()
												.addGroup(panel7Layout.createParallelGroup()
													.addComponent(label26, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
													.addComponent(label28))
												.addGap(25, 25, 25)
												.addGroup(panel7Layout.createParallelGroup()
													.addComponent(txtOrderCustomer, GroupLayout.DEFAULT_SIZE, 186, Short.MAX_VALUE)
													.addComponent(txtOrderID, GroupLayout.DEFAULT_SIZE, 186, Short.MAX_VALUE)))
											.addGroup(panel7Layout.createSequentialGroup()
												.addGroup(panel7Layout.createParallelGroup()
													.addComponent(label29)
													.addComponent(label30))
												.addGap(20, 20, 20)
												.addGroup(panel7Layout.createParallelGroup()
													.addComponent(txtOrderDate)
													.addComponent(txtPaymentDate, GroupLayout.DEFAULT_SIZE, 186, Short.MAX_VALUE))))
										.addGroup(panel7Layout.createParallelGroup()
											.addGroup(panel7Layout.createSequentialGroup()
												.addGap(141, 141, 141)
												.addComponent(txtOrderCustomerID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGroup(panel7Layout.createSequentialGroup()
												.addGap(18, 18, 18)
												.addComponent(btnOrderCustomer)))
										.addGap(59, 59, 59)
										.addGroup(panel7Layout.createParallelGroup()
											.addComponent(label33, GroupLayout.PREFERRED_SIZE, 92, GroupLayout.PREFERRED_SIZE)
											.addComponent(label34, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)
											.addComponent(label32)
											.addComponent(label35, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE))
										.addGroup(panel7Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
											.addComponent(txtOrderSum)
											.addComponent(txtOrderDiscount, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
											.addComponent(cbOrderStatus, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
											.addComponent(txtOrderNote, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))
										.addGap(0, 64, Short.MAX_VALUE))
									.addGroup(panel7Layout.createSequentialGroup()
										.addGap(0, 236, Short.MAX_VALUE)
										.addComponent(btnOrderReset)
										.addGap(18, 18, 18)
										.addComponent(btnOrderSave)
										.addGap(18, 18, 18)
										.addComponent(btnOrderAddProduct)
										.addGap(197, 197, 197))))
					);
					panel7Layout.setVerticalGroup(
						panel7Layout.createParallelGroup()
							.addGroup(panel7Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel7Layout.createParallelGroup()
									.addGroup(panel7Layout.createSequentialGroup()
										.addComponent(label32)
										.addGap(18, 18, 18)
										.addComponent(label33)
										.addGap(18, 18, 18)
										.addComponent(label34)
										.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
										.addComponent(label35))
									.addGroup(panel7Layout.createSequentialGroup()
										.addGroup(panel7Layout.createParallelGroup()
											.addComponent(label26)
											.addComponent(txtOrderCustomerID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
											.addComponent(txtOrderID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
										.addGap(18, 18, 18)
										.addGroup(panel7Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(label28)
											.addComponent(txtOrderCustomer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
											.addComponent(btnOrderCustomer))
										.addGap(18, 18, 18)
										.addGroup(panel7Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(label29)
											.addComponent(txtOrderDate, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
										.addGap(18, 18, 18)
										.addGroup(panel7Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(label30)
											.addComponent(txtPaymentDate, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
									.addGroup(panel7Layout.createSequentialGroup()
										.addComponent(cbOrderStatus, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
										.addGap(18, 18, 18)
										.addComponent(txtOrderSum, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
										.addGap(18, 18, 18)
										.addComponent(txtOrderDiscount, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
										.addComponent(txtOrderNote, GroupLayout.PREFERRED_SIZE, 52, GroupLayout.PREFERRED_SIZE)))
								.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 69, Short.MAX_VALUE)
								.addGroup(panel7Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(btnOrderReset)
									.addComponent(btnOrderSave)
									.addComponent(btnOrderAddProduct))
								.addContainerGap())
					);
				}

				//======== scrollPaneProduct3 ========
				{
					scrollPaneProduct3.addMouseListener(new MouseAdapter() {
						@Override
						public void mouseClicked(MouseEvent e) {
							scrollPaneProductMouseClicked(e);
						}
						@Override
						public void mousePressed(MouseEvent e) {
							scrollPaneProductMousePressed(e);
						}
					});

					//---- tableOrder ----
					tableOrder.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
					tableOrder.setAutoCreateRowSorter(true);
					tableOrder.addMouseListener(new MouseAdapter() {
						@Override
						public void mousePressed(MouseEvent e) {
							tableProductMousePressed(e);
							tableOrderMousePressed(e);
						}
					});
					scrollPaneProduct3.setViewportView(tableOrder);
				}

				//---- btnOrderSaveAll ----
				btnOrderSaveAll.setText("L\u01b0u d\u1eef li\u1ec7u");
				btnOrderSaveAll.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnOrderSaveAllActionPerformed(e);
					}
				});

				//---- btnOrderReload ----
				btnOrderReload.setText("T\u1ea3i l\u1ea1i d\u1eef li\u1ec7u");
				btnOrderReload.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnOrderReloadActionPerformed(e);
					}
				});

				//======== panel11 ========
				{
					panel11.setBorder(new TitledBorder("T\u00ecm ki\u1ebfm \u0111\u01a1n \u0111\u1eb7t h\u00e0ng"));

					//---- label52 ----
					label52.setText("ID");

					//---- label53 ----
					label53.setText("Ng\u00e0y \u0111\u1eb7t t\u1eeb");

					//---- label54 ----
					label54.setText("\u0110\u1ebfn");

					//---- label55 ----
					label55.setText("Ng\u00e0y thanh to\u00e1n t\u1eeb");

					//---- label56 ----
					label56.setText("\u0110\u1ebfn");

					//---- label14 ----
					label14.setText("Ghi ch\u00fa");

					//---- btnSearchOrder ----
					btnSearchOrder.setText("T\u00ecm ki\u1ebfm");
					btnSearchOrder.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnSearchProductActionPerformed(e);
							btnSearchOrderActionPerformed(e);
						}
					});

					//---- orderDateFromChooser ----
					orderDateFromChooser.setDateFormatString("yyyy-MM-dd");

					//---- orderDateToChooser ----
					orderDateToChooser.setDateFormatString("yyyy-MM-dd");

					//---- paymentDateFromChooser ----
					paymentDateFromChooser.setDateFormatString("yyyy-MM-dd");

					//---- paymentDateToChooser ----
					paymentDateToChooser.setDateFormatString("yyyy-MM-dd");

					//---- label20 ----
					label20.setText("T\u00ean kh\u00e1ch h\u00e0ng");

					GroupLayout panel11Layout = new GroupLayout(panel11);
					panel11.setLayout(panel11Layout);
					panel11Layout.setHorizontalGroup(
						panel11Layout.createParallelGroup()
							.addGroup(panel11Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel11Layout.createParallelGroup()
									.addGroup(GroupLayout.Alignment.TRAILING, panel11Layout.createSequentialGroup()
										.addGap(0, 83, Short.MAX_VALUE)
										.addComponent(btnSearchOrder, GroupLayout.PREFERRED_SIZE, 155, GroupLayout.PREFERRED_SIZE)
										.addGap(70, 70, 70))
									.addGroup(panel11Layout.createSequentialGroup()
										.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
											.addGroup(GroupLayout.Alignment.LEADING, panel11Layout.createSequentialGroup()
												.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
													.addComponent(label53, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
													.addComponent(label54, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
													.addComponent(label55, GroupLayout.DEFAULT_SIZE, 101, Short.MAX_VALUE))
												.addGap(12, 12, 12)
												.addGroup(panel11Layout.createParallelGroup()
													.addComponent(orderDateFromChooser, GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
													.addComponent(orderDateToChooser, GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
													.addComponent(paymentDateFromChooser, GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)))
											.addGroup(GroupLayout.Alignment.LEADING, panel11Layout.createSequentialGroup()
												.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
													.addComponent(label56, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
													.addComponent(label14, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))
												.addGap(49, 49, 49)
												.addGroup(panel11Layout.createParallelGroup()
													.addComponent(paymentDateToChooser, GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
													.addComponent(txtSearchOrderDescription, GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)))
											.addGroup(GroupLayout.Alignment.LEADING, panel11Layout.createSequentialGroup()
												.addGroup(panel11Layout.createParallelGroup()
													.addComponent(label20, GroupLayout.PREFERRED_SIZE, 84, GroupLayout.PREFERRED_SIZE)
													.addComponent(label52, GroupLayout.PREFERRED_SIZE, 69, GroupLayout.PREFERRED_SIZE))
												.addGap(29, 29, 29)
												.addGroup(panel11Layout.createParallelGroup()
													.addComponent(txtSearchOrderID, GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
													.addComponent(txtSearchOrderCustomer, GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE))))
										.addContainerGap(38, Short.MAX_VALUE))))
					);
					panel11Layout.setVerticalGroup(
						panel11Layout.createParallelGroup()
							.addGroup(panel11Layout.createSequentialGroup()
								.addGap(17, 17, 17)
								.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label52)
									.addComponent(txtSearchOrderID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label20)
									.addComponent(txtSearchOrderCustomer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
									.addComponent(label53)
									.addComponent(orderDateFromChooser, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
									.addComponent(label54)
									.addComponent(orderDateToChooser, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
									.addComponent(label55)
									.addComponent(paymentDateFromChooser, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
									.addComponent(label56)
									.addComponent(paymentDateToChooser, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGap(18, 18, 18)
								.addGroup(panel11Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
									.addComponent(label14)
									.addComponent(txtSearchOrderDescription, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
								.addComponent(btnSearchOrder)
								.addContainerGap())
					);
				}

				GroupLayout panelOrderLayout = new GroupLayout(panelOrder);
				panelOrder.setLayout(panelOrderLayout);
				panelOrderLayout.setHorizontalGroup(
					panelOrderLayout.createParallelGroup()
						.addGroup(panelOrderLayout.createSequentialGroup()
							.addGap(20, 20, 20)
							.addGroup(panelOrderLayout.createParallelGroup()
								.addGroup(panelOrderLayout.createSequentialGroup()
									.addComponent(panel7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addGap(79, 79, 79)
									.addComponent(panel11, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addComponent(scrollPaneProduct3))
							.addContainerGap(48, Short.MAX_VALUE))
						.addGroup(GroupLayout.Alignment.TRAILING, panelOrderLayout.createSequentialGroup()
							.addContainerGap(539, Short.MAX_VALUE)
							.addComponent(btnOrderReload)
							.addGap(18, 18, 18)
							.addComponent(btnOrderSaveAll)
							.addGap(542, 542, 542))
				);
				panelOrderLayout.setVerticalGroup(
					panelOrderLayout.createParallelGroup()
						.addGroup(panelOrderLayout.createSequentialGroup()
							.addGroup(panelOrderLayout.createParallelGroup()
								.addGroup(panelOrderLayout.createSequentialGroup()
									.addGap(20, 20, 20)
									.addComponent(panel7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGroup(panelOrderLayout.createSequentialGroup()
									.addContainerGap()
									.addComponent(panel11, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
							.addGap(43, 43, 43)
							.addComponent(scrollPaneProduct3, GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)
							.addGap(18, 18, 18)
							.addGroup(panelOrderLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
								.addComponent(btnOrderSaveAll)
								.addComponent(btnOrderReload))
							.addGap(67, 67, 67))
				);
			}
			panelMain.addTab("QU\u1ea2N L\u00dd \u0110\u01a0N \u0110\u1eb6T H\u00c0NG", panelOrder);

			//======== panelImport ========
			{

				//======== panel8 ========
				{
					panel8.setBorder(new TitledBorder("Chi ti\u1ebft nh\u1eadp kho"));

					//---- label37 ----
					label37.setText("ID");

					//---- label39 ----
					label39.setText("T\u1ed5ng c\u1ed9ng");

					//---- label40 ----
					label40.setText("Ng\u00e0y t\u1ea1o");

					//---- label41 ----
					label41.setText("Ghi ch\u00fa");

					//---- txtImportID ----
					txtImportID.setEditable(false);

					//---- txtImportCreateDate ----
					txtImportCreateDate.setEditable(false);

					//---- btnImportReset ----
					btnImportReset.setText("X\u00f3a bi\u1ec3u m\u1eabu");
					btnImportReset.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnProductResetActionPerformed(e);
							btnCustomerResetActionPerformed(e);
							btnOrderResetActionPerformed(e);
							btnImportResetActionPerformed(e);
							btnImportResetActionPerformed(e);
						}
					});

					//---- btnImportSave ----
					btnImportSave.setText("T\u1ea1o phi\u1ebfu nh\u1eadp");
					btnImportSave.addActionListener(new ActionListener() {
						@Override
						public void actionPerformed(ActionEvent e) {
							btnProductSaveActionPerformed(e);
							btnCustomerSaveActionPerformed(e);
							btnOrderSaveActionPerformed(e);
							btnImportSaveActionPerformed(e);
						}
					});

					//======== scrollPaneProduct4 ========
					{
						scrollPaneProduct4.addMouseListener(new MouseAdapter() {
							@Override
							public void mouseClicked(MouseEvent e) {
								scrollPaneProductMouseClicked(e);
							}
							@Override
							public void mousePressed(MouseEvent e) {
								scrollPaneProductMousePressed(e);
							}
						});

						//---- tableImport ----
						tableImport.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
						tableImport.setAutoCreateRowSorter(true);
						tableImport.addMouseListener(new MouseAdapter() {
							@Override
							public void mousePressed(MouseEvent e) {
								tableProductMousePressed(e);
								tableImportMousePressed(e);
							}
						});
						scrollPaneProduct4.setViewportView(tableImport);
					}

					GroupLayout panel8Layout = new GroupLayout(panel8);
					panel8.setLayout(panel8Layout);
					panel8Layout.setHorizontalGroup(
						panel8Layout.createParallelGroup()
							.addGroup(panel8Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel8Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
									.addGroup(panel8Layout.createSequentialGroup()
										.addComponent(label37, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(txtImportID, GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE))
									.addGroup(panel8Layout.createSequentialGroup()
										.addGroup(panel8Layout.createParallelGroup()
											.addComponent(label39)
											.addComponent(label40))
										.addGap(55, 55, 55)
										.addGroup(panel8Layout.createParallelGroup()
											.addComponent(txtImportCreateDate)
											.addComponent(txtImportSum)))
									.addGroup(panel8Layout.createSequentialGroup()
										.addComponent(label41)
										.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
										.addGroup(panel8Layout.createParallelGroup()
											.addComponent(txtImportNote)
											.addGroup(panel8Layout.createSequentialGroup()
												.addComponent(btnImportReset)
												.addGap(18, 18, 18)
												.addComponent(btnImportSave)
												.addGap(0, 0, Short.MAX_VALUE)))))
								.addGap(74, 74, 74)
								.addComponent(scrollPaneProduct4, GroupLayout.PREFERRED_SIZE, 360, GroupLayout.PREFERRED_SIZE)
								.addContainerGap(489, Short.MAX_VALUE))
					);
					panel8Layout.linkSize(SwingConstants.HORIZONTAL, new Component[] {label37, label40, label41});
					panel8Layout.setVerticalGroup(
						panel8Layout.createParallelGroup()
							.addGroup(panel8Layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(panel8Layout.createParallelGroup()
									.addComponent(scrollPaneProduct4, GroupLayout.PREFERRED_SIZE, 183, GroupLayout.PREFERRED_SIZE)
									.addGroup(panel8Layout.createSequentialGroup()
										.addGroup(panel8Layout.createParallelGroup()
											.addComponent(txtImportID, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
											.addGroup(panel8Layout.createSequentialGroup()
												.addComponent(label37)
												.addGap(56, 56, 56)
												.addGroup(panel8Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
													.addComponent(label39)
													.addComponent(txtImportSum, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
												.addGap(18, 18, 18)
												.addGroup(panel8Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
													.addComponent(label40)
													.addComponent(txtImportCreateDate, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
												.addGap(18, 18, 18)
												.addGroup(panel8Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
													.addComponent(label41)
													.addComponent(txtImportNote, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
										.addGap(69, 69, 69)
										.addGroup(panel8Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
											.addComponent(btnImportReset)
											.addComponent(btnImportSave))))
								.addContainerGap(30, Short.MAX_VALUE))
					);
					panel8Layout.linkSize(SwingConstants.VERTICAL, new Component[] {label37, label40, label41});
				}

				//---- btnImportSaveAll ----
				btnImportSaveAll.setText("L\u01b0u d\u1eef li\u1ec7u");
				btnImportSaveAll.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnImportSaveAllActionPerformed(e);
					}
				});

				//---- btnImportReload ----
				btnImportReload.setText("T\u1ea3i l\u1ea1i d\u1eef li\u1ec7u");
				btnImportReload.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnImportReloadActionPerformed(e);
					}
				});

				//======== scrollPane3 ========
				{
					scrollPane3.setViewportView(tableImportDetail);
				}

				//======== scrollPane2 ========
				{
					scrollPane2.setViewportView(tableProductImport);
				}

				//---- label21 ----
				label21.setText("Tu khoa");

				//---- btnProductImportSearch ----
				btnProductImportSearch.setText("Tim kiem");
				btnProductImportSearch.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnProductAddSearchActionPerformed(e);
						btnProductImportSearchActionPerformed(e);
					}
				});

				//---- label23 ----
				label23.setText("S\u1ed1 l\u01b0\u01a1ng");

				//---- txtProductImportQuantity ----
				txtProductImportQuantity.setText("1");
				txtProductImportQuantity.addKeyListener(new KeyAdapter() {
					@Override
					public void keyTyped(KeyEvent e) {
						txtProductAddQuantityKeyTyped(e);
						txtProductImportQuantityKeyTyped(e);
					}
				});

				//---- btnProductImport ----
				btnProductImport.setText("Th\u00eam");
				btnProductImport.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnProductAddActionPerformed(e);
						btnProductAddActionPerformed(e);
						btnProductImportActionPerformed(e);
					}
				});

				GroupLayout panelImportLayout = new GroupLayout(panelImport);
				panelImport.setLayout(panelImportLayout);
				panelImportLayout.setHorizontalGroup(
					panelImportLayout.createParallelGroup()
						.addGroup(panelImportLayout.createSequentialGroup()
							.addGroup(panelImportLayout.createParallelGroup()
								.addGroup(panelImportLayout.createSequentialGroup()
									.addContainerGap()
									.addComponent(panel8, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
								.addGroup(panelImportLayout.createSequentialGroup()
									.addGroup(panelImportLayout.createParallelGroup()
										.addGroup(panelImportLayout.createSequentialGroup()
											.addGap(437, 437, 437)
											.addComponent(btnImportReload))
										.addGroup(panelImportLayout.createSequentialGroup()
											.addGap(31, 31, 31)
											.addGroup(panelImportLayout.createParallelGroup()
												.addGroup(panelImportLayout.createSequentialGroup()
													.addComponent(label21, GroupLayout.PREFERRED_SIZE, 69, GroupLayout.PREFERRED_SIZE)
													.addGap(18, 18, 18)
													.addComponent(txtProductImportKeyword, GroupLayout.PREFERRED_SIZE, 195, GroupLayout.PREFERRED_SIZE)
													.addGap(18, 18, 18)
													.addComponent(btnProductImportSearch))
												.addComponent(scrollPane2, GroupLayout.PREFERRED_SIZE, 466, GroupLayout.PREFERRED_SIZE))))
									.addGap(52, 52, 52)
									.addGroup(panelImportLayout.createParallelGroup()
										.addGroup(panelImportLayout.createSequentialGroup()
											.addGroup(panelImportLayout.createParallelGroup()
												.addGroup(panelImportLayout.createSequentialGroup()
													.addComponent(label23, GroupLayout.PREFERRED_SIZE, 117, GroupLayout.PREFERRED_SIZE)
													.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
													.addComponent(txtProductImportQuantity, GroupLayout.PREFERRED_SIZE, 102, GroupLayout.PREFERRED_SIZE))
												.addGroup(panelImportLayout.createSequentialGroup()
													.addGap(26, 26, 26)
													.addComponent(btnProductImport, GroupLayout.PREFERRED_SIZE, 140, GroupLayout.PREFERRED_SIZE)))
											.addGap(12, 12, 12)
											.addComponent(scrollPane3, GroupLayout.PREFERRED_SIZE, 409, GroupLayout.PREFERRED_SIZE))
										.addComponent(btnImportSaveAll))))
							.addContainerGap(51, Short.MAX_VALUE))
				);
				panelImportLayout.linkSize(SwingConstants.HORIZONTAL, new Component[] {btnImportReload, btnImportSaveAll});
				panelImportLayout.setVerticalGroup(
					panelImportLayout.createParallelGroup()
						.addGroup(panelImportLayout.createSequentialGroup()
							.addContainerGap()
							.addComponent(panel8, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addGroup(panelImportLayout.createParallelGroup()
								.addGroup(panelImportLayout.createSequentialGroup()
									.addGroup(panelImportLayout.createParallelGroup()
										.addGroup(panelImportLayout.createSequentialGroup()
											.addGap(26, 26, 26)
											.addGroup(panelImportLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label21)
												.addComponent(txtProductImportKeyword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
												.addComponent(btnProductImportSearch))
											.addGap(27, 27, 27)
											.addComponent(scrollPane2, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE))
										.addGroup(panelImportLayout.createSequentialGroup()
											.addGap(81, 81, 81)
											.addGroup(panelImportLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
												.addComponent(label23)
												.addComponent(txtProductImportQuantity, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGap(18, 18, 18)
											.addComponent(btnProductImport)))
									.addGap(74, 74, 74)
									.addGroup(panelImportLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
										.addComponent(btnImportSaveAll)
										.addComponent(btnImportReload)))
								.addGroup(panelImportLayout.createSequentialGroup()
									.addGap(18, 18, 18)
									.addComponent(scrollPane3, GroupLayout.PREFERRED_SIZE, 183, GroupLayout.PREFERRED_SIZE)))
							.addContainerGap(95, Short.MAX_VALUE))
				);
				panelImportLayout.linkSize(SwingConstants.VERTICAL, new Component[] {btnImportReload, btnImportSaveAll});
			}
			panelMain.addTab("QU\u1ea2N L\u00dd NH\u1eacP KHO", panelImport);

			//======== panelReport ========
			{

				//---- dateChooser ----
				dateChooser.setDateFormatString("YYYY-MM-dd");
				dateChooser.addPropertyChangeListener(new PropertyChangeListener() {
					@Override
					public void propertyChange(PropertyChangeEvent e) {
						dateChooserPropertyChange(e);
					}
				});

				GroupLayout panelReportLayout = new GroupLayout(panelReport);
				panelReport.setLayout(panelReportLayout);
				panelReportLayout.setHorizontalGroup(
					panelReportLayout.createParallelGroup()
						.addGroup(panelReportLayout.createSequentialGroup()
							.addGap(149, 149, 149)
							.addComponent(dateChooser, GroupLayout.PREFERRED_SIZE, 232, GroupLayout.PREFERRED_SIZE)
							.addContainerGap(898, Short.MAX_VALUE))
				);
				panelReportLayout.setVerticalGroup(
					panelReportLayout.createParallelGroup()
						.addGroup(panelReportLayout.createSequentialGroup()
							.addGap(47, 47, 47)
							.addComponent(dateChooser, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addContainerGap(634, Short.MAX_VALUE))
				);
			}
			panelMain.addTab("L\u1eacP B\u00c1O C\u00c1O", panelReport);

			//======== panelStatistic ========
			{

				//---- btnExportToExcel ----
				btnExportToExcel.setText("text");
				btnExportToExcel.addActionListener(new ActionListener() {
					@Override
					public void actionPerformed(ActionEvent e) {
						btnExportToExcelActionPerformed(e);
					}
				});

				GroupLayout panelStatisticLayout = new GroupLayout(panelStatistic);
				panelStatistic.setLayout(panelStatisticLayout);
				panelStatisticLayout.setHorizontalGroup(
					panelStatisticLayout.createParallelGroup()
						.addGroup(panelStatisticLayout.createSequentialGroup()
							.addGap(381, 381, 381)
							.addComponent(btnExportToExcel, GroupLayout.PREFERRED_SIZE, 174, GroupLayout.PREFERRED_SIZE)
							.addContainerGap(724, Short.MAX_VALUE))
				);
				panelStatisticLayout.setVerticalGroup(
					panelStatisticLayout.createParallelGroup()
						.addGroup(panelStatisticLayout.createSequentialGroup()
							.addGap(71, 71, 71)
							.addComponent(btnExportToExcel)
							.addContainerGap(607, Short.MAX_VALUE))
				);
			}
			panelMain.addTab("TH\u1ed0NG K\u00ca", panelStatistic);
		}

		GroupLayout contentPaneLayout = new GroupLayout(contentPane);
		contentPane.setLayout(contentPaneLayout);
		contentPaneLayout.setHorizontalGroup(
			contentPaneLayout.createParallelGroup()
				.addComponent(panelMain)
		);
		contentPaneLayout.setVerticalGroup(
			contentPaneLayout.createParallelGroup()
				.addComponent(panelMain, GroupLayout.Alignment.TRAILING)
		);
		pack();
		setLocationRelativeTo(getOwner());
		// JFormDesigner - End of component initialization  //GEN-END:initComponents
	}

	// JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
	// Generated using JFormDesigner Evaluation license - Hoan Tran
	private JTabbedPane panelMain;
	private JPanel panelProduct;
	private JPanel panel5;
	private JLabel label4;
	private JLabel label5;
	private JLabel label6;
	private JLabel label7;
	private JLabel label8;
	private JLabel label9;
	private JLabel label10;
	private JLabel label11;
	private JLabel label12;
	private JLabel label13;
	private JTextField txtProductID;
	private JTextField txtProductName;
	private JTextField txtProductCode;
	private JTextField txtProductQuantity;
	private JTextField txtProductColor;
	private JTextField txtProductPrice;
	private JTextField txtProductSalePrice;
	private JTextField txtProductCreateDate;
	private JLabel labelImage;
	private JTextField txtImage;
	private JButton btnImage;
	private JComboBox cbCategoryName;
	private JButton btnProductReset;
	private JButton btnProductSave;
	private JScrollPane scrollPane1;
	private JTextArea txtProductDescription;
	private JScrollPane scrollPaneProduct;
	private JTable tableProduct;
	private JButton btnProductSaveAll;
	private JButton btnProductReload;
	private JPanel panel9;
	private JLabel label42;
	private JLabel label43;
	private JLabel label44;
	private JLabel label45;
	private JLabel label46;
	private JTextField txtSearchProductName;
	private JTextField txtSearchProductColor;
	private JTextField txtSearchProductDescription;
	private JTextField txtSearchProductPriceFrom;
	private JTextField txtSearchProductCode;
	private JTextField txtSearchProductPriceTo;
	private JLabel label1;
	private JLabel label2;
	private JComboBox cbSearchCategoryName;
	private JButton btnSearchProduct;
	private JPanel panelCustomer;
	private JPanel panel6;
	private JLabel label15;
	private JLabel label16;
	private JLabel label17;
	private JLabel label18;
	private JLabel label19;
	private JLabel label22;
	private JTextField txtCustomerID;
	private JTextField txtCustomerName;
	private JTextField txtCustomerPhone;
	private JTextField txtCustomerAddress;
	private JTextField txtCustomerScore;
	private JButton btnCustomerReset;
	private JButton btnCustomerSave;
	private JTextField txtCustomerLevel;
	private JScrollPane scrollPaneProduct2;
	private JTable tableCustomer;
	private JButton btnCustomerSaveAll;
	private JButton btnCustomerReload;
	private JPanel panel10;
	private JLabel label47;
	private JLabel label48;
	private JLabel label49;
	private JLabel label50;
	private JLabel label51;
	private JTextField txtSearchCustomerName;
	private JTextField txtSearchCustomerAddress;
	private JTextField txtSearchCustomerScoreFrom;
	private JTextField txtSearchCustomerPhone;
	private JTextField txtSearchCustomerScoreTo;
	private JLabel label3;
	private JButton btnSearchCustomer;
	private JComboBox cbSearchCustomerLevel;
	private JPanel panelOrder;
	private JPanel panel7;
	private JLabel label26;
	private JLabel label28;
	private JLabel label29;
	private JLabel label30;
	private JLabel label32;
	private JLabel label33;
	private JLabel label34;
	private JLabel label35;
	private JTextField txtOrderID;
	private JTextField txtOrderCustomer;
	private JTextField txtOrderDate;
	private JTextField txtPaymentDate;
	private JTextField txtOrderSum;
	private JTextField txtOrderDiscount;
	private JTextField txtOrderNote;
	private JComboBox cbOrderStatus;
	private JButton btnOrderCustomer;
	private JTextField txtOrderCustomerID;
	private JButton btnOrderReset;
	private JButton btnOrderSave;
	private JButton btnOrderAddProduct;
	private JScrollPane scrollPaneProduct3;
	private JTable tableOrder;
	private JButton btnOrderSaveAll;
	private JButton btnOrderReload;
	private JPanel panel11;
	private JLabel label52;
	private JLabel label53;
	private JLabel label54;
	private JLabel label55;
	private JLabel label56;
	private JTextField txtSearchOrderID;
	private JTextField txtSearchOrderDescription;
	private JLabel label14;
	private JButton btnSearchOrder;
	private JDateChooser orderDateFromChooser;
	private JDateChooser orderDateToChooser;
	private JDateChooser paymentDateFromChooser;
	private JDateChooser paymentDateToChooser;
	private JLabel label20;
	private JTextField txtSearchOrderCustomer;
	private JPanel panelImport;
	private JPanel panel8;
	private JLabel label37;
	private JLabel label39;
	private JLabel label40;
	private JLabel label41;
	private JTextField txtImportID;
	private JTextField txtImportSum;
	private JTextField txtImportCreateDate;
	private JTextField txtImportNote;
	private JButton btnImportReset;
	private JButton btnImportSave;
	private JScrollPane scrollPaneProduct4;
	private JTable tableImport;
	private JButton btnImportSaveAll;
	private JButton btnImportReload;
	private JScrollPane scrollPane3;
	private JTable tableImportDetail;
	private JScrollPane scrollPane2;
	private JTable tableProductImport;
	private JLabel label21;
	private JTextField txtProductImportKeyword;
	private JButton btnProductImportSearch;
	private JLabel label23;
	private JTextField txtProductImportQuantity;
	private JButton btnProductImport;
	private JPanel panelReport;
	private JDateChooser dateChooser;
	private JPanel panelStatistic;
	private JButton btnExportToExcel;
	// JFormDesigner - End of variables declaration  //GEN-END:variables
}
